[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Forms/Browser/tests - testEditView.py:1.3
Jim Fulton
jim@zope.com
Sun, 1 Dec 2002 05:22:35 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Forms/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv32402/tests
Modified Files:
testEditView.py
Log Message:
Fixed bug in edit view. Edity views didn't generate ObjectModifiedEvents.
=== Zope3/lib/python/Zope/App/Forms/Browser/tests/testEditView.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/Forms/Browser/tests/testEditView.py:1.2 Sat Nov 30 13:33:52 2002
+++ Zope3/lib/python/Zope/App/Forms/Browser/tests/testEditView.py Sun Dec 1 05:22:33 2002
@@ -15,6 +15,7 @@
"""
from unittest import TestCase, TestSuite, main, makeSuite
from Zope.App.tests.PlacelessSetup import PlacelessSetup
+from Zope.Event.tests.PlacelessSetup import getEvents
from Interface import Interface
from Zope.Schema import TextLine
from Zope.Schema.IField import ITextLine
@@ -72,6 +73,7 @@
self.assertEqual(c.a , u'c a')
self.assertEqual(c.b , u'c b')
self.assertEqual(c.baz, u'c baz')
+ self.failIf(getEvents())
def test_apply_update(self):
c = C()
@@ -87,6 +89,7 @@
self.assertEqual(c.a , u'c a')
self.assertEqual(c.b , u'c b')
self.assertEqual(c.baz, u'd baz')
+ self.failUnless(getEvents(filter=lambda event: event.object == c))
def test_update_no_update(self):
c = C()
@@ -109,6 +112,7 @@
self.assertEqual(c.a , u'c a')
self.assertEqual(c.b , u'c b')
self.assertEqual(c.baz, u'c baz')
+ self.failIf(getEvents())
def test_update(self):
c = C()