def testExecute(self): e = WorkflowStateCondition() e.wf_states = ['visible', 'private'] ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable) self.assertEquals(True, ex()) self.portal.portal_workflow.doActionFor(self.folder, 'publish') ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable) self.assertEquals(False, ex()) ex = getMultiAdapter((self.portal, e, DummyEvent(self.portal)), IExecutable) self.assertEquals(False, ex())
def testInvokeEditView(self): element = getUtility(IRuleCondition, name='plone.conditions.WorkflowState') e = WorkflowStateCondition() editview = getMultiAdapter((e, self.folder.REQUEST), name=element.editview) self.assertTrue(isinstance(editview, WorkflowStateEditForm))