Example #1
0
    def test_notify_new_resource_created_and_added(self, resource_meta, config, pool):
        events = create_event_listener(config, IResourceCreatedAndAdded)
        meta = resource_meta._replace(iresource=IResource, use_autonaming=True)
        user = testing.DummyResource()

        resource = self.make_one(meta)(parent=pool, creator=user)

        assert IResourceCreatedAndAdded.providedBy(events[0])
        assert events[0].object == resource
        assert events[0].parent == pool
Example #2
0
    def test_notify_new_resource_created_and_added(self, resource_meta, config,
                                                   pool):
        events = create_event_listener(config, IResourceCreatedAndAdded)
        meta = resource_meta._replace(iresource=IResource, use_autonaming=True)
        user = testing.DummyResource()

        resource = self.make_one(meta)(parent=pool, creator=user)

        assert IResourceCreatedAndAdded.providedBy(events[0])
        assert events[0].object == resource
        assert events[0].parent == pool
Example #3
0
    def test_create(self):
        from adhocracy_core.interfaces import IResourceCreatedAndAdded
        context = testing.DummyResource()
        parent = testing.DummyResource()
        registry = testing.DummyResource()
        creator = testing.DummyResource()

        inst = self.make_one(context, parent, registry, creator)

        assert IResourceCreatedAndAdded.providedBy(inst)
        assert verifyObject(IResourceCreatedAndAdded, inst)
Example #4
0
    def test_create(self):
        from adhocracy_core.interfaces import IResourceCreatedAndAdded
        context = testing.DummyResource()
        parent = testing.DummyResource()
        registry = testing.DummyResource()
        creator = testing.DummyResource()

        inst = self.make_one(context, parent, registry, creator)

        assert IResourceCreatedAndAdded.providedBy(inst)
        assert verifyObject(IResourceCreatedAndAdded, inst)