Пример #1
0
    def testExecute(self):
        e = WorkflowAction()
        e.transition = 'publish'

        ex = getMultiAdapter((self.folder, e, DummyEvent(self.folder.d1)), IExecutable)
        self.assertEqual(True, ex())

        self.assertEqual('published', self.portal.portal_workflow.getInfoFor(self.folder.d1, 'review_state'))
Пример #2
0
    def testExecuteWithError(self):
        e = WorkflowAction()
        e.transition = 'foobar'

        old_state = self.portal.portal_workflow.getInfoFor(self.folder.d1, 'review_state')

        ex = getMultiAdapter((self.folder, e, DummyEvent(self.folder.d1)), IExecutable)
        self.assertEqual(False, ex())

        self.assertEqual(old_state, self.portal.portal_workflow.getInfoFor(self.folder.d1, 'review_state'))
Пример #3
0
 def testInvokeEditView(self):
     element = getUtility(IRuleAction, name='plone.actions.Workflow')
     e = WorkflowAction()
     editview = getMultiAdapter((e, self.folder.REQUEST),
                                name=element.editview)
     self.assertTrue(isinstance(editview, WorkflowEditForm))