[Zope-Checkins] SVN: Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py Work correctly with event dispatching:

Florent Guillaume fg at nuxeo.com
Tue Nov 1 13:44:04 EST 2005


Log message for revision 39820:
  Work correctly with event dispatching:
  - mark a test class as deprecated,
  - use a container class that implements IItem.
  
  

Changed:
  U   Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py

-=-
Modified: Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py
===================================================================
--- Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py	2005-11-01 17:49:19 UTC (rev 39819)
+++ Zope/branches/philikon-zope32-integration/lib/python/OFS/tests/testObjectManager.py	2005-11-01 18:44:03 UTC (rev 39820)
@@ -48,7 +48,15 @@
             raise DeleteFailed
         return SimpleItem.manage_beforeDelete(self, item, container)
 
+from Products.Five.eventconfigure import setDeprecatedManageAddDelete
+setDeprecatedManageAddDelete(ItemForDeletion)
 
+from zope.interface import implements
+from OFS.interfaces import IItem
+class ObjectManagerWithIItem(ObjectManager):
+    """The event subscribers work on IItem."""
+    implements(IItem)
+
 class ObjectManagerTests( unittest.TestCase ):
 
     def setUp(self):
@@ -62,11 +70,8 @@
         getConfiguration().debug_mode = mode
 
     def _getTargetClass( self ):
+        return ObjectManagerWithIItem
 
-        from OFS.ObjectManager import ObjectManager
-
-        return ObjectManager
-
     def _makeOne( self, *args, **kw ):
 
         return self._getTargetClass()( *args, **kw ).__of__( FauxRoot() )



More information about the Zope-Checkins mailing list