Ejemplo n.º 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'))
Ejemplo n.º 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'))