def testExecute(self):
        e = GroupCondition()
        e.group_names = ['Administrators', 'Reviewers']

        ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable)
        self.assertEquals(False, ex())

        group = self.portal.portal_groups.getGroupById('Administrators')
        group.addMember(self.portal.portal_membership.getAuthenticatedMember().getId())

        ex = getMultiAdapter((self.portal, e, DummyEvent(self.portal)), IExecutable)
        self.assertEquals(True, ex())
    def testExecute(self):
        e = GroupCondition()
        e.group_names = ['Administrators', 'Reviewers']

        ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable)
        self.assertFalse(ex())

        group = self.portal.portal_groups.getGroupById('Administrators')
        group.addMember(self.portal.portal_membership.getAuthenticatedMember().getId())

        ex = getMultiAdapter((self.portal, e, DummyEvent(self.portal)), IExecutable)
        self.assertTrue(ex())
Example #3
0
 def testInvokeEditView(self):
     element = getUtility(IRuleCondition, name='plone.conditions.Group')
     e = GroupCondition()
     editview = getMultiAdapter((e, self.folder.REQUEST),
                                name=element.editview)
     self.assertTrue(isinstance(editview, GroupEditFormView))