Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testRegistered
def testInvokeAddView
def testInvokeEditView
def testExecute

Detailed Description

Definition at line 23 of file test_condition_wfstate.py.


Member Function Documentation

Definition at line 25 of file test_condition_wfstate.py.

00025 
00026     def afterSetUp(self):
00027         self.setRoles(('Manager',))

Here is the call graph for this function:

Definition at line 56 of file test_condition_wfstate.py.

00056 
00057     def testExecute(self): 
00058         e = WorkflowStateCondition()
00059         e.wf_states = ['visible', 'private']
00060         
00061         ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable)
00062         self.assertEquals(True, ex())
00063         
00064         self.portal.portal_workflow.doActionFor(self.folder, 'publish')
00065         
00066         ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable)
00067         self.assertEquals(False, ex())
00068         
00069         ex = getMultiAdapter((self.portal, e, DummyEvent(self.portal)), IExecutable)
00070         self.assertEquals(False, ex())
        

Here is the call graph for this function:

Definition at line 35 of file test_condition_wfstate.py.

00035 
00036     def testInvokeAddView(self): 
00037         element = getUtility(IRuleCondition, name='plone.conditions.WorkflowState')
00038         storage = getUtility(IRuleStorage)
00039         storage[u'foo'] = Rule()
00040         rule = self.portal.restrictedTraverse('++rule++foo')
00041         
00042         adding = getMultiAdapter((rule, self.portal.REQUEST), name='+condition')
00043         addview = getMultiAdapter((adding, self.portal.REQUEST), name=element.addview)
00044         
00045         addview.createAndAdd(data={'wf_states' : ['visible', 'published']})
00046         
00047         e = rule.conditions[0]
00048         self.failUnless(isinstance(e, WorkflowStateCondition))
00049         self.assertEquals(['visible', 'published'], e.wf_states)
    

Definition at line 50 of file test_condition_wfstate.py.

00050 
00051     def testInvokeEditView(self): 
00052         element = getUtility(IRuleCondition, name='plone.conditions.WorkflowState')
00053         e = WorkflowStateCondition()
00054         editview = getMultiAdapter((e, self.folder.REQUEST), name=element.editview)
00055         self.failUnless(isinstance(editview, WorkflowStateEditForm))

Definition at line 28 of file test_condition_wfstate.py.

00028 
00029     def testRegistered(self): 
00030         element = getUtility(IRuleCondition, name='plone.conditions.WorkflowState')
00031         self.assertEquals('plone.conditions.WorkflowState', element.addview)
00032         self.assertEquals('edit', element.editview)
00033         self.assertEquals(None, element.for_)
00034         self.assertEquals(IObjectEvent, element.event)
    

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