Skip to content

Commit 5ed2796

Browse files
committed
Fix pr comments
1 parent 35deb4b commit 5ed2796

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/commercetools/testing/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def updater(self, obj, action):
121121
if not isinstance(value, datetime):
122122
raise TypeError(f"Unsupported datetime object type: f{type(value)}")
123123

124-
if obj.get(dst) != value:
124+
if obj.get(dst) != value.isoformat():
125125
new = copy.deepcopy(obj)
126126
new[dst] = value.isoformat()
127127
return new
@@ -134,7 +134,7 @@ def update_nested_object_attribute(dst: str, src: str):
134134
def updater(self, obj, action):
135135
values = getattr(action, src)
136136

137-
if not isinstance(values, typing.List):
137+
if not isinstance(values, list):
138138
raise TypeError(f"Unsupported nested object type: f{type(values)}")
139139

140140
if obj.get(dst) != values:

tests/platform/test_service_cart_discounts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def test_cart_discount_set_valid_from(old_client):
107107
)
108108
)
109109
assert cart_discount.id
110+
assert cart_discount.valid_from is None
110111

111112
cart_discount = old_client.cart_discounts.update_by_id(
112113
id=cart_discount.id,
@@ -130,6 +131,7 @@ def test_cart_discount_set_valid_until(old_client):
130131
)
131132
)
132133
assert cart_discount.id
134+
assert cart_discount.valid_until is None
133135

134136
cart_discount = old_client.cart_discounts.update_by_id(
135137
id=cart_discount.id,

0 commit comments

Comments
 (0)