Skip to content

Commit 2c54e5c

Browse files
committed
Fix publish action on mock backend
Already published products got overwritten
1 parent 7be023e commit 2c54e5c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
8.1.1 (unreleased)
2+
------------------
3+
- Fix publish action on mock backend; already published products got overwritten
4+
15
8.1.0 (2020-05-01)
26
------------------
37
- Added product publish and set prices actions on mock backend.

src/commercetools/testing/products.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def _publish_product_action():
231231
def updater(self, obj: dict, action: types.ProductPublishAction):
232232
new = copy.deepcopy(obj)
233233
# not implemented scopes right now.
234-
if "staged" in new["masterData"]:
234+
if new["masterData"].get("staged"):
235235
new["masterData"]["current"] = new["masterData"]["staged"]
236236
new["masterData"]["hasStagedChanges"] = False
237237
new["masterData"]["published"] = True

0 commit comments

Comments
 (0)