Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.workflow.tests.test_one_state_workflow.TestOneStateWorkflow Class Reference
Inheritance diagram for plone.app.workflow.tests.test_one_state_workflow.TestOneStateWorkflow:
Inheritance graph
[legend]
Collaboration diagram for plone.app.workflow.tests.test_one_state_workflow.TestOneStateWorkflow:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testInitialState
def testViewIsNotAcquiredInPublishedState
def testViewPublishedDocument
def testAccessContentsInformationIsNotAcquiredInPublishedState
def testAccessPublishedDocument
def testModifyPortalContentIsNotAcquiredInPublishedState
def testModifyPublishedDocument
def testChangeEventsIsNotAcquiredInPublishedState
def testModifyPublishEvent

Public Attributes

 catalog
 workflow
 doc
 ev

Detailed Description

Definition at line 21 of file test_one_state_workflow.py.


Member Function Documentation

Definition at line 24 of file test_one_state_workflow.py.

00024 
00025     def afterSetUp(self):
00026         self.catalog = self.portal.portal_catalog
00027         self.workflow = self.portal.portal_workflow
00028         self.workflow.setChainForPortalTypes(['Document','Event'], 'one_state_workflow')
00029 
00030         self.portal.acl_users._doAddUser('member', 'secret', ['Member'], [])
00031         self.portal.acl_users._doAddUser('reviewer', 'secret', ['Reviewer'], [])
00032         self.portal.acl_users._doAddUser('manager', 'secret', ['Manager'], [])
00033         self.portal.acl_users._doAddUser('editor' , ' secret', ['Editor'],[])
00034         self.portal.acl_users._doAddUser('reader', 'secret', ['Reader'], [])
00035 
00036 
00037         self.folder.invokeFactory('Document', id='doc')
00038         self.doc = self.folder.doc
00039         self.folder.invokeFactory('Event', id='ev')
00040         self.ev = self.folder.ev

Definition at line 74 of file test_one_state_workflow.py.

00074 
00075     def testAccessContentsInformationIsNotAcquiredInPublishedState(self):
00076         self.assertEqual(self.doc.acquiredRolesAreUsedBy(AccessContentsInformation), '')   # not checked

Definition at line 77 of file test_one_state_workflow.py.

00077 
00078     def testAccessPublishedDocument(self):
00079         # Owner is allowed
00080         self.login(default_user)
00081         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00082         # Member is allowed
00083         self.login('member')
00084         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00085         # Reviewer is allowed
00086         self.login('reviewer')
00087         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00088         # Anonymous is allowed
00089         self.logout()
00090         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00091         # Editor is allowed
00092         self.login('editor')
00093         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00094         # Reader is allowed
00095         self.login('reader')
00096         self.failUnless(checkPerm(AccessContentsInformation, self.doc))

Here is the call graph for this function:

Definition at line 122 of file test_one_state_workflow.py.

00122 
00123     def testChangeEventsIsNotAcquiredInPublishedState(self):
00124         self.assertEqual(self.ev.acquiredRolesAreUsedBy(ChangeEvents), '')

Definition at line 43 of file test_one_state_workflow.py.

00043 
00044     def testInitialState(self):
00045         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'published')
00046         self.assertEqual(self.workflow.getInfoFor(self.ev, 'review_state'), 'published')

Definition at line 97 of file test_one_state_workflow.py.

00097 
00098     def testModifyPortalContentIsNotAcquiredInPublishedState(self):
00099         self.assertEqual(self.doc.acquiredRolesAreUsedBy(ModifyPortalContent), '')

Definition at line 100 of file test_one_state_workflow.py.

00100 
00101     def testModifyPublishedDocument(self):
00102         # Owner is allowed
00103         self.login(default_user)
00104         self.failUnless(checkPerm(ModifyPortalContent, self.doc))
00105         # Member is denied
00106         self.login('member')
00107         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00108         # Reviewer is denied
00109         self.login('reviewer')
00110         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00111         # Anonymous is denied
00112         self.logout()
00113         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00114         # Editor is allowed
00115         self.login('editor')
00116         self.failUnless(checkPerm(ModifyPortalContent, self.doc))
00117         # Reader is denied
00118         self.login('reader')
00119         self.failIf(checkPerm(ModifyPortalContent, self.doc))

Here is the call graph for this function:

Definition at line 125 of file test_one_state_workflow.py.

00125 
00126     def testModifyPublishEvent(self):
00127         # Owner is allowed
00128         self.failUnless(checkPerm(ChangeEvents, self.ev))
00129         # Member is denied
00130         self.login('member')
00131         self.failIf(checkPerm(ChangeEvents, self.ev))
00132         # Reviewer is denied
00133         self.login('reviewer')
00134         self.failIf(checkPerm(ChangeEvents, self.ev))
00135         # Anonymous is denied
00136         self.logout()
00137         self.failIf(checkPerm(ChangeEvents, self.ev))
00138         # Editor is allowed
00139         self.login('editor')
00140         self.failUnless(checkPerm(ChangeEvents, self.ev))
00141         # Reader is denied
00142         self.login('reader')
00143         self.failIf(checkPerm(ChangeEvents, self.ev))
00144 

Here is the call graph for this function:

Definition at line 49 of file test_one_state_workflow.py.

00049 
00050     def testViewIsNotAcquiredInPublishedState(self):
00051         self.assertEqual(self.doc.acquiredRolesAreUsedBy(View), '')   # not checked

Definition at line 52 of file test_one_state_workflow.py.

00052 
00053     def testViewPublishedDocument(self):
00054         # Owner is allowed
00055         self.login(default_user)
00056         self.failUnless(checkPerm(View, self.doc))
00057         # Member is allowed
00058         self.login('member')
00059         self.failUnless(checkPerm(View, self.doc))
00060         # Reviewer is allowed
00061         self.login('reviewer')
00062         self.failUnless(checkPerm(View, self.doc))
00063         # Anonymous is allowed
00064         self.logout()
00065         self.failUnless(checkPerm(View, self.doc))
00066         # Editor is allowed
00067         self.login('editor')
00068         self.failUnless(checkPerm(View, self.doc))
00069         # Reader is allowed
00070         self.login('reader')
00071         self.failUnless(checkPerm(View, self.doc))

Here is the call graph for this function:


Member Data Documentation

Definition at line 25 of file test_one_state_workflow.py.

Definition at line 37 of file test_one_state_workflow.py.

Definition at line 39 of file test_one_state_workflow.py.

Definition at line 26 of file test_one_state_workflow.py.


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