def test_notify_resource_sheet_modified(self, inst, context, config): from adhocracy_core.interfaces import IResourceSheetModified from adhocracy_core.testing import create_event_listener events = create_event_listener(config, IResourceSheetModified) inst.set({'count': 2}) assert IResourceSheetModified.providedBy(events[0]) assert events[0].object == context assert events[0].registry == config.registry assert events[0].old_appstruct == {'count': 0} assert events[0].new_appstruct == {'count': 2}
def test_create(self): from adhocracy_core.interfaces import IResourceSheetModified context = testing.DummyResource() parent = testing.DummyResource() registry = testing.DummyResource() request = testing.DummyResource() old_appstruct = {} new_appstruct = {} inst = self.make_one(context, parent, registry, old_appstruct, new_appstruct, request) assert IResourceSheetModified.providedBy(inst) assert verifyObject(IResourceSheetModified, inst) assert inst.object is context assert inst.registry is registry assert inst.old_appstruct is old_appstruct assert inst.new_appstruct is new_appstruct assert inst.request is request