[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/observable/ Fix pickling issue and thus complete the test

Philipp von Weitershausen philikon at philikon.de
Fri Sep 24 14:32:03 EDT 2004


Log message for revision 27681:
  Fix pickling issue and thus complete the test
  


Changed:
  U   Zope3/trunk/src/zope/app/observable/ftests.py
  U   Zope3/trunk/src/zope/app/observable/observable.txt


-=-
Modified: Zope3/trunk/src/zope/app/observable/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/observable/ftests.py	2004-09-24 18:13:54 UTC (rev 27680)
+++ Zope3/trunk/src/zope/app/observable/ftests.py	2004-09-24 18:32:02 UTC (rev 27681)
@@ -4,11 +4,15 @@
 from zope.app.annotation.interfaces import IAttributeAnnotatable
 from zope.app.tests.functional import FunctionalDocFileSuite
 
+def chickenModified(event):
+     print "buh-PAH! I was modified."
+
 class Chicken(Persistent):
      implements(IAttributeAnnotatable)
 
 def test_suite():
-    globs = {'Chicken': Chicken}
+    globs = {'Chicken': Chicken,
+             'chickenModified': chickenModified}
     return unittest.TestSuite((
 	FunctionalDocFileSuite('observable.txt', globs=globs),
         ))

Modified: Zope3/trunk/src/zope/app/observable/observable.txt
===================================================================
--- Zope3/trunk/src/zope/app/observable/observable.txt	2004-09-24 18:13:54 UTC (rev 27680)
+++ Zope3/trunk/src/zope/app/observable/observable.txt	2004-09-24 18:32:02 UTC (rev 27681)
@@ -16,8 +16,6 @@
 
 Now consider a possible subscriber for an object event:
 
-  >>> def chickenModified(event):
-  ...     print "buh-PAH! I was modified."
 
 Now we register it using the observable adapter:
 
@@ -25,16 +23,8 @@
   >>> from zope.app.event.interfaces import IObjectModifiedEvent
   >>> observer = IObservable(chicken)
   >>> observer.handle([IObjectModifiedEvent], chickenModified)
+  >>> get_transaction().commit()
 
-  TODO:
-
-  We really should be committing the transation here because that's
-  when the actual interaction of observers with the persistency
-  machinery comes in.  Right now it fails for no apparent reason.
-  --philiKON
-
-  >>> #get_transaction().commit()
-
 When we now issue an ``IObjectModifiedEvent`` event, our subscriber
 will be called:
 



More information about the Zope3-Checkins mailing list