[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container/tests - test_contents.py:1.13.10.3

Marius Gedminas mgedmin@codeworks.lt
Fri, 16 May 2003 04:34:12 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/container/tests
In directory cvs.zope.org:/tmp/cvs-serv421/src/zope/app/browser/container/tests

Modified Files:
      Tag: stevea-decorators-branch
	test_contents.py 
Log Message:
Update one of container tests to cope with additional events caused by
context decoration.


=== Zope3/src/zope/app/browser/container/tests/test_contents.py 1.13.10.2 => 1.13.10.3 ===
--- Zope3/src/zope/app/browser/container/tests/test_contents.py:1.13.10.2	Thu May 15 11:04:20 2003
+++ Zope3/src/zope/app/browser/container/tests/test_contents.py	Fri May 16 04:34:11 2003
@@ -43,7 +43,7 @@
 from zope.app.container.copypastemove import CopySource
 from zope.app.container.copypastemove import PasteNamesChooser
 
-from zope.app.event.tests.placelesssetup import getEvents
+from zope.app.event.tests.placelesssetup import getEvents, clearEvents
 from zope.app.interfaces.event import IObjectRemovedEvent, IObjectModifiedEvent
 from zope.interface import Interface
 from zope.proxy.introspection import removeAllProxies
@@ -136,8 +136,14 @@
 
         fc = self._TestView__newView(container)
 
-        self.failIf(getEvents(IObjectModifiedEvent))
         self.failIf(getEvents(IObjectRemovedEvent))
+        self.failUnless(
+            getEvents(IObjectModifiedEvent,
+                      filter =
+                      lambda event:
+                      removeAllProxies(event.object) == container)
+           )
+        clearEvents()
 
         fc.removeObjects(['document2'])