def manage_beforeDelete(self, item, container): Item.manage_beforeDelete(self, item, container) if self is item: # unregister self from catalog on deletion tr_tool = getToolByName(self, 'portal_transforms') tr_tool.unregisterTransform(self.id)
def setUp(self): obj = Item('obj') self.helpers = self._makeOne(obj, DummySetupEnviron()) provideAdapter(MarkerInterfacesAdapter, (IItem, )) provideInterface('', IDummyMarker)
def manage_beforeDelete(self, item, container): Item.manage_beforeDelete(self, item, container) if self is item: # unregister self from catalog on deletion tr_tool = getToolByName(self, 'portal_transforms') tr_tool.unregisterTransform(self.id)
def _makeContext(self): from OFS.SimpleItem import Item return Item('obj')