Skip to content

Commit 412b3e0

Browse files
committed
Change update nested object func to compare actual lists of items
1 parent 5ed2796 commit 412b3e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/commercetools/testing/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,12 @@ def updater(self, obj, action):
137137
if not isinstance(values, list):
138138
raise TypeError(f"Unsupported nested object type: f{type(values)}")
139139

140-
if obj.get(dst) != values:
140+
items = [item.serialize() for item in values]
141+
if items != obj.get(dst):
141142
new = copy.deepcopy(obj)
142-
new[dst] = [item.serialize() for item in values]
143+
new[dst] = items
143144
return new
145+
144146
return obj
145147

146148
return updater

0 commit comments

Comments
 (0)