[CMF-checkins] CVS: Products/CMFCore/tests - test_OpaqueItems.py:1.9

Grégoire Weber zope.org at incept.ch
Thu Jul 22 09:47:48 EDT 2004


Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv15204/tests

Modified Files:
	test_OpaqueItems.py 
Log Message:
- The object to which the opaque item has to be assigned has now to be passed the __init__ method of the IOpaqueItems interface
- updated unit tests accordingly


=== Products/CMFCore/tests/test_OpaqueItems.py 1.8 => 1.9 ===
--- Products/CMFCore/tests/test_OpaqueItems.py:1.8	Mon Jul 19 18:40:32 2004
+++ Products/CMFCore/tests/test_OpaqueItems.py	Thu Jul 22 09:47:48 2004
@@ -35,10 +35,10 @@
             self.opaqueItem = 'noncallable'
             self.opaqueItemsId = 'opaqueItem'
         elif isinstance(opaqueItem, basestring):
-            setattr(self, opaqueItem, Hooks(opaqueItem))
+            Hooks(self, opaqueItem)
             self.opaqueItemsId = opaqueItem
         else:
-            self.opaqueItem = opaqueItem('opaqueItem')
+            opaqueItem(self, 'opaqueItem')
             self.opaqueItemsId = 'opaqueItem'
 
     # Ensure additional attributes get copied
@@ -60,10 +60,11 @@
 class OpaqueBase:
     """ Dummy opaque item without manage_after/before hookes
     """
-    def __init__(self, id):
-        self.id = id
+    def __init__(self, obj, id):
         self.addCount = self.cloneCount = self.deleteCount = 0
         self.addCounter = self.cloneCounter = self.deleteCounter = 1
+        self.id = id
+        setattr(obj, id, self)
         
     def __call__():
         return



More information about the CMF-checkins mailing list