Commit a022f459 authored by Florent Guillaume's avatar Florent Guillaume

Work correctly with event dispatching:

- mark a test class as deprecated,
- use a container class that implements IItem.
parent 3ce2ac81
...@@ -48,6 +48,14 @@ class ItemForDeletion(SimpleItem): ...@@ -48,6 +48,14 @@ class ItemForDeletion(SimpleItem):
raise DeleteFailed raise DeleteFailed
return SimpleItem.manage_beforeDelete(self, item, container) 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 ): class ObjectManagerTests( unittest.TestCase ):
...@@ -62,10 +70,7 @@ class ObjectManagerTests( unittest.TestCase ): ...@@ -62,10 +70,7 @@ class ObjectManagerTests( unittest.TestCase ):
getConfiguration().debug_mode = mode getConfiguration().debug_mode = mode
def _getTargetClass( self ): def _getTargetClass( self ):
return ObjectManagerWithIItem
from OFS.ObjectManager import ObjectManager
return ObjectManager
def _makeOne( self, *args, **kw ): def _makeOne( self, *args, **kw ):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment