Skip to content

Commit

Permalink
Merge branch 'master' into linkintegrity-items-total
Browse files Browse the repository at this point in the history
  • Loading branch information
tisto authored Aug 23, 2023
2 parents 83d5ed3 + ed070e0 commit e0e0526
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions news/1680.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix test cleanup. @davisagli
13 changes: 7 additions & 6 deletions src/plone/restapi/tests/test_content_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ def move_object(event):

sm.registerHandler(move_object, (IObjectAddedEvent,))

obj = create(self.folder, "Document", "my-document")
notify(ObjectCreatedEvent(obj))
obj = add(self.folder, obj)
self.assertEqual(aq_parent(obj), self.portal)

sm.unregisterHandler(move_object, (IObjectAddedEvent,))
try:
obj = create(self.folder, "Document", "my-document")
notify(ObjectCreatedEvent(obj))
obj = add(self.folder, obj)
self.assertEqual(aq_parent(obj), self.portal)
finally:
sm.unregisterHandler(move_object, (IObjectAddedEvent,))

0 comments on commit e0e0526

Please sign in to comment.