Back to index

plone3  3.1.7
Public Member Functions
plone.app.contentrules.tests.test_action_workflow.TestWorkflowAction Class Reference
Inheritance diagram for plone.app.contentrules.tests.test_action_workflow.TestWorkflowAction:
Inheritance graph
[legend]
Collaboration diagram for plone.app.contentrules.tests.test_action_workflow.TestWorkflowAction:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testRegistered
def testInvokeAddView
def testInvokeEditView
def testExecute
def testExecuteWithError

Detailed Description

Definition at line 23 of file test_action_workflow.py.


Member Function Documentation

Definition at line 25 of file test_action_workflow.py.

00025 
00026     def afterSetUp(self):
00027         self.setRoles(('Manager',))
00028         self.folder.invokeFactory('Document', 'd1')

Here is the call graph for this function:

Definition at line 57 of file test_action_workflow.py.

00057 
00058     def testExecute(self): 
00059         e = WorkflowAction()
00060         e.transition = 'publish'
00061         
00062         ex = getMultiAdapter((self.folder, e, DummyEvent(self.folder.d1)), IExecutable)
00063         self.assertEquals(True, ex())
00064         
00065         self.assertEquals('published', self.portal.portal_workflow.getInfoFor(self.folder.d1, 'review_state'))
        

Here is the call graph for this function:

Definition at line 66 of file test_action_workflow.py.

00066 
00067     def testExecuteWithError(self): 
00068         e = WorkflowAction()
00069         e.transition = 'foobar'
00070         
00071         old_state = self.portal.portal_workflow.getInfoFor(self.folder.d1, 'review_state')
00072         
00073         ex = getMultiAdapter((self.folder, e, DummyEvent(self.folder.d1)), IExecutable)
00074         self.assertEquals(False, ex())
00075         
00076         self.assertEquals(old_state, self.portal.portal_workflow.getInfoFor(self.folder.d1, 'review_state'))
        

Here is the call graph for this function:

Definition at line 36 of file test_action_workflow.py.

00036 
00037     def testInvokeAddView(self): 
00038         element = getUtility(IRuleAction, name='plone.actions.Workflow')
00039         storage = getUtility(IRuleStorage)
00040         storage[u'foo'] = Rule()
00041         rule = self.portal.restrictedTraverse('++rule++foo')
00042         
00043         adding = getMultiAdapter((rule, self.portal.REQUEST), name='+action')
00044         addview = getMultiAdapter((adding, self.portal.REQUEST), name=element.addview)
00045         
00046         addview.createAndAdd(data={'transition' : 'publish',})
00047         
00048         e = rule.actions[0]
00049         self.failUnless(isinstance(e, WorkflowAction))
00050         self.assertEquals('publish', e.transition)
    

Definition at line 51 of file test_action_workflow.py.

00051 
00052     def testInvokeEditView(self): 
00053         element = getUtility(IRuleAction, name='plone.actions.Workflow')
00054         e = WorkflowAction()
00055         editview = getMultiAdapter((e, self.folder.REQUEST), name=element.editview)
00056         self.failUnless(isinstance(editview, WorkflowEditForm))

Definition at line 29 of file test_action_workflow.py.

00029 
00030     def testRegistered(self): 
00031         element = getUtility(IRuleAction, name='plone.actions.Workflow')
00032         self.assertEquals('plone.actions.Workflow', element.addview)
00033         self.assertEquals('edit', element.editview)
00034         self.assertEquals(None, element.for_)
00035         self.assertEquals(IObjectEvent, element.event)
    

The documentation for this class was generated from the following file: