Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testOwnerHidesVisibleDocument
def testOwnerShowsPrivateDocument
def testOwnerSubmitsVisibleDocument
def testOwnerRetractsPendingDocument
def testOwnerRetractsPublishedDocument
def testReviewerPublishesPendingDocument
def testReviewerRejectsPendingDocument
def testReviewerPublishesVisibleDocument
def testReviewerRejectsPublishedDocument
def testOwnerPublishesVisibleDocument
def testOwnerSubmitsPrivateDocument
def testManagerPublishesPrivateDocument
def testViewVisibleDocument
def testViewIsNotAcquiredInVisibleState
def testViewPrivateDocument
def testViewIsNotAcquiredInPrivateState
def testViewPendingDocument
def testViewIsNotAcquiredInPendingState
def testViewPublishedDocument
def testViewIsNotAcquiredInPublishedState
def testAccessVisibleDocument
def testAccessContentsInformationIsNotAcquiredInVisibleState
def testAccessPrivateDocument
def testAccessContentsInformationIsNotAcquiredInPrivateState
def testAccessPendingDocument
def testAccessContentsInformationIsNotAcquiredInPendingState
def testAccessPublishedDocument
def testAccessContentsInformationIsNotAcquiredInPublishedState
def testModifyVisibleDocument
def testModifyPortalContentIsNotAcquiredInVisibleState
def testModifyPrivateDocument
def testModifyPortalContentIsNotAcquiredInPrivateState
def testModifyPendingDocument
def testModifyPortalContentIsNotAcquiredInPendingState
def testModifyPublishedDocument
def testModifyPortalContentIsNotAcquiredInPublishedState
def testModifyVisibleEvent
def testChangeEventsIsNotAcquiredInVisibleState
def testModifyPrivateEvent
def testChangeEventsIsNotAcquiredInPrivateState
def testModifyPendingEvent
def testChangeEventsIsNotAcquiredInPendingState
def testModifyPublishedEvent
def testChangeEventsIsNotAcquiredInPublishedState
def testFindVisibleDocument
def testFindPrivateDocument
def testFindPendingDocument
def testFindPublishedDocument
def testMyWorklist
def testStateTitles

Public Attributes

 catalog
 workflow
 doc
 ev

Detailed Description

Definition at line 19 of file test_plone_workflow.py.


Member Function Documentation

Definition at line 21 of file test_plone_workflow.py.

00021 
00022     def afterSetUp(self):
00023         self.catalog = self.portal.portal_catalog
00024         self.workflow = self.portal.portal_workflow
00025         
00026         self.workflow.setChainForPortalTypes(['Document','Event'], 'plone_workflow')
00027 
00028         self.portal.acl_users._doAddUser('member', 'secret', ['Member'], [])
00029         self.portal.acl_users._doAddUser('reviewer', 'secret', ['Reviewer'], [])
00030         self.portal.acl_users._doAddUser('manager', 'secret', ['Manager'], [])
00031 
00032         self.folder.invokeFactory('Document', id='doc')
00033         self.doc = self.folder.doc
00034 
00035         self.folder.invokeFactory('Event', id='ev')
00036         self.ev = self.folder.ev

Definition at line 249 of file test_plone_workflow.py.

00249 
00250     def testAccessContentsInformationIsNotAcquiredInPendingState(self):
00251         self.workflow.doActionFor(self.doc, 'submit')
00252         self.assertEqual(self.doc.acquiredRolesAreUsedBy(AccessContentsInformation), '')

Definition at line 231 of file test_plone_workflow.py.

00231 
00232     def testAccessContentsInformationIsNotAcquiredInPrivateState(self):
00233         self.workflow.doActionFor(self.doc, 'hide')
00234         self.assertEqual(self.doc.acquiredRolesAreUsedBy(AccessContentsInformation), '')

Definition at line 269 of file test_plone_workflow.py.

00269 
00270     def testAccessContentsInformationIsNotAcquiredInPublishedState(self):
00271         self.login('reviewer')
00272         self.workflow.doActionFor(self.doc, 'publish')
00273         self.assertEqual(self.doc.acquiredRolesAreUsedBy(AccessContentsInformation), '')

Here is the call graph for this function:

Definition at line 214 of file test_plone_workflow.py.

00214 
00215     def testAccessContentsInformationIsNotAcquiredInVisibleState(self):
00216         self.assertEqual(self.doc.acquiredRolesAreUsedBy(AccessContentsInformation), '')

Definition at line 235 of file test_plone_workflow.py.

00235 
00236     def testAccessPendingDocument(self):
00237         self.workflow.doActionFor(self.doc, 'submit')
00238         # Owner is allowed
00239         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00240         # Member is allowed (TODO:?)
00241         self.login('member')
00242         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00243         # Reviewer is allowed
00244         self.login('reviewer')
00245         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00246         # Anonymous is allowed (TODO:?)
00247         self.logout()
00248         self.failUnless(checkPerm(AccessContentsInformation, self.doc))

Here is the call graph for this function:

Definition at line 217 of file test_plone_workflow.py.

00217 
00218     def testAccessPrivateDocument(self):
00219         self.workflow.doActionFor(self.doc, 'hide')
00220         # Owner is allowed
00221         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00222         # Member is denied
00223         self.login('member')
00224         self.failIf(checkPerm(AccessContentsInformation, self.doc))
00225         # Reviewer is denied
00226         self.login('reviewer')
00227         self.failIf(checkPerm(AccessContentsInformation, self.doc))
00228         # Anonymous is denied
00229         self.logout()
00230         self.failIf(checkPerm(AccessContentsInformation, self.doc))

Here is the call graph for this function:

Definition at line 253 of file test_plone_workflow.py.

00253 
00254     def testAccessPublishedDocument(self):
00255         self.login('reviewer')
00256         self.workflow.doActionFor(self.doc, 'publish')
00257         # Owner is allowed
00258         self.login(default_user)
00259         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00260         # Member is allowed
00261         self.login('member')
00262         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00263         # Reviewer is allowed
00264         self.login('reviewer')
00265         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00266         # Anonymous is allowed
00267         self.logout()
00268         self.failUnless(checkPerm(AccessContentsInformation, self.doc))

Here is the call graph for this function:

Definition at line 201 of file test_plone_workflow.py.

00201 
00202     def testAccessVisibleDocument(self):
00203         # Owner is allowed
00204         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00205         # Member is allowed
00206         self.login('member')
00207         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00208         # Reviewer is allowed
00209         self.login('reviewer')
00210         self.failUnless(checkPerm(AccessContentsInformation, self.doc))
00211         # Anonymous is allowed
00212         self.logout()
00213         self.failUnless(checkPerm(AccessContentsInformation, self.doc))

Here is the call graph for this function:

Definition at line 399 of file test_plone_workflow.py.

00399 
00400     def testChangeEventsIsNotAcquiredInPendingState(self):
00401         self.workflow.doActionFor(self.ev, 'submit')
00402         self.assertEqual(self.ev.acquiredRolesAreUsedBy(ChangeEvents), '')

Definition at line 381 of file test_plone_workflow.py.

00381 
00382     def testChangeEventsIsNotAcquiredInPrivateState(self):
00383         self.workflow.doActionFor(self.ev, 'hide')
00384         self.assertEqual(self.ev.acquiredRolesAreUsedBy(ChangeEvents), '')

Definition at line 419 of file test_plone_workflow.py.

00419 
00420     def testChangeEventsIsNotAcquiredInPublishedState(self):
00421         self.login('reviewer')
00422         self.workflow.doActionFor(self.ev, 'publish')
00423         self.assertEqual(self.ev.acquiredRolesAreUsedBy(ChangeEvents), '')

Here is the call graph for this function:

Definition at line 364 of file test_plone_workflow.py.

00364 
00365     def testChangeEventsIsNotAcquiredInVisibleState(self):
00366         self.assertEqual(self.ev.acquiredRolesAreUsedBy(ChangeEvents), '')

Definition at line 453 of file test_plone_workflow.py.

00453 
00454     def testFindPendingDocument(self):
00455         self.workflow.doActionFor(self.doc, 'submit')
00456         # Owner is allowed
00457         self.failUnless(self.catalog(id='doc'))
00458         # Member is allowed (TODO:?)
00459         self.login('member')
00460         self.failUnless(self.catalog(id='doc'))
00461         # Reviewer is allowed
00462         self.login('reviewer')
00463         self.failUnless(self.catalog(id='doc'))
00464         # Anonymous is allowed (TODO:?)
00465         self.logout()
00466         self.failUnless(self.catalog(id='doc'))

Here is the call graph for this function:

Definition at line 439 of file test_plone_workflow.py.

00439 
00440     def testFindPrivateDocument(self):
00441         self.workflow.doActionFor(self.doc, 'hide')
00442         # Owner is allowed
00443         self.failUnless(self.catalog(id='doc'))
00444         # Member is denied
00445         self.login('member')
00446         self.failIf(self.catalog(id='doc'))
00447         # Reviewer is denied
00448         self.login('reviewer')
00449         self.failIf(self.catalog(id='doc'))
00450         # Anonymous is denied
00451         self.logout()
00452         self.failIf(self.catalog(id='doc'))

Here is the call graph for this function:

Definition at line 467 of file test_plone_workflow.py.

00467 
00468     def testFindPublishedDocument(self):
00469         self.login('reviewer')
00470         self.workflow.doActionFor(self.doc, 'publish')
00471         # Owner is allowed
00472         self.login(default_user)
00473         self.failUnless(self.catalog(id='doc'))
00474         # Member is allowed
00475         self.login('member')
00476         self.failUnless(self.catalog(id='doc'))
00477         # Reviewer is allowed
00478         self.login('reviewer')
00479         self.failUnless(self.catalog(id='doc'))
00480         # Anonymous is allowed
00481         self.logout()
00482         self.failUnless(self.catalog(id='doc'))

Here is the call graph for this function:

Definition at line 426 of file test_plone_workflow.py.

00426 
00427     def testFindVisibleDocument(self):
00428         # Owner is allowed
00429         self.failUnless(self.catalog(id='doc'))
00430         # Member is allowed
00431         self.login('member')
00432         self.failUnless(self.catalog(id='doc'))
00433         # Reviewer is allowed
00434         self.login('reviewer')
00435         self.failUnless(self.catalog(id='doc'))
00436         # Anonymous is allowed
00437         self.logout()
00438         self.failUnless(self.catalog(id='doc'))

Here is the call graph for this function:

Definition at line 116 of file test_plone_workflow.py.

00116 
00117     def testManagerPublishesPrivateDocument(self):
00118         self.workflow.doActionFor(self.doc, 'hide')
00119         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'private')
00120         self.login('manager')
00121         self.assertRaises(WorkflowException, self.workflow.doActionFor, self.doc, 'publish')

Here is the call graph for this function:

Definition at line 310 of file test_plone_workflow.py.

00310 
00311     def testModifyPendingDocument(self):
00312         self.workflow.doActionFor(self.doc, 'submit')
00313         # Owner is denied
00314         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00315         # Member is denied
00316         self.login('member')
00317         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00318         # Reviewer is allowed
00319         self.login('reviewer')
00320         self.failUnless(checkPerm(ModifyPortalContent, self.doc))
00321         # Anonymous is denied
00322         self.logout()
00323         self.failIf(checkPerm(ModifyPortalContent, self.doc))

Here is the call graph for this function:

Definition at line 385 of file test_plone_workflow.py.

00385 
00386     def testModifyPendingEvent(self):
00387         self.workflow.doActionFor(self.ev, 'submit')
00388         # Owner is denied
00389         self.failIf(checkPerm(ChangeEvents, self.ev))
00390         # Member is denied
00391         self.login('member')
00392         self.failIf(checkPerm(ChangeEvents, self.ev))
00393         # Reviewer is allowed
00394         self.login('reviewer')
00395         self.failUnless(checkPerm(ChangeEvents, self.ev))
00396         # Anonymous is denied
00397         self.logout()
00398         self.failIf(checkPerm(ChangeEvents, self.ev))

Here is the call graph for this function:

Definition at line 324 of file test_plone_workflow.py.

00324 
00325     def testModifyPortalContentIsNotAcquiredInPendingState(self):
00326         self.workflow.doActionFor(self.doc, 'submit')
00327         self.assertEqual(self.doc.acquiredRolesAreUsedBy(ModifyPortalContent), '')

Definition at line 306 of file test_plone_workflow.py.

00306 
00307     def testModifyPortalContentIsNotAcquiredInPrivateState(self):
00308         self.workflow.doActionFor(self.doc, 'hide')
00309         self.assertEqual(self.doc.acquiredRolesAreUsedBy(ModifyPortalContent), '')

Definition at line 344 of file test_plone_workflow.py.

00344 
00345     def testModifyPortalContentIsNotAcquiredInPublishedState(self):
00346         self.login('reviewer')
00347         self.workflow.doActionFor(self.doc, 'publish')
00348         self.assertEqual(self.doc.acquiredRolesAreUsedBy(ModifyPortalContent), '')

Here is the call graph for this function:

Definition at line 289 of file test_plone_workflow.py.

00289 
00290     def testModifyPortalContentIsNotAcquiredInVisibleState(self):
00291         self.assertEqual(self.doc.acquiredRolesAreUsedBy(ModifyPortalContent), '')

Definition at line 292 of file test_plone_workflow.py.

00292 
00293     def testModifyPrivateDocument(self):
00294         self.workflow.doActionFor(self.doc, 'hide')
00295         # Owner is allowed
00296         self.failUnless(checkPerm(ModifyPortalContent, self.doc))
00297         # Member is denied
00298         self.login('member')
00299         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00300         # Reviewer is denied
00301         self.login('reviewer')
00302         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00303         # Anonymous is denied
00304         self.logout()
00305         self.failIf(checkPerm(ModifyPortalContent, self.doc))

Here is the call graph for this function:

Definition at line 367 of file test_plone_workflow.py.

00367 
00368     def testModifyPrivateEvent(self):
00369         self.workflow.doActionFor(self.ev, 'hide')
00370         # Owner is allowed
00371         self.failUnless(checkPerm(ChangeEvents, self.ev))
00372         # Member is denied
00373         self.login('member')
00374         self.failIf(checkPerm(ChangeEvents, self.ev))
00375         # Reviewer is denied
00376         self.login('reviewer')
00377         self.failIf(checkPerm(ChangeEvents, self.ev))
00378         # Anonymous is denied
00379         self.logout()
00380         self.failIf(checkPerm(ChangeEvents, self.ev))

Here is the call graph for this function:

Definition at line 328 of file test_plone_workflow.py.

00328 
00329     def testModifyPublishedDocument(self):
00330         self.login('reviewer')
00331         self.workflow.doActionFor(self.doc, 'publish')
00332         # Owner is denied
00333         self.login(default_user)
00334         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00335         # Member is denied
00336         self.login('member')
00337         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00338         # Reviewer is denied
00339         self.login('reviewer')
00340         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00341         # Anonymous is denied
00342         self.logout()
00343         self.failIf(checkPerm(ModifyPortalContent, self.doc))

Here is the call graph for this function:

Definition at line 403 of file test_plone_workflow.py.

00403 
00404     def testModifyPublishedEvent(self):
00405         self.login('reviewer')
00406         self.workflow.doActionFor(self.ev, 'publish')
00407         # Owner is denied
00408         self.login(default_user)
00409         self.failIf(checkPerm(ChangeEvents, self.ev))
00410         # Member is denied
00411         self.login('member')
00412         self.failIf(checkPerm(ChangeEvents, self.ev))
00413         # Reviewer is denied
00414         self.login('reviewer')
00415         self.failIf(checkPerm(ChangeEvents, self.ev))
00416         # Anonymous is denied
00417         self.logout()
00418         self.failIf(checkPerm(ChangeEvents, self.ev))

Here is the call graph for this function:

Definition at line 276 of file test_plone_workflow.py.

00276 
00277     def testModifyVisibleDocument(self):
00278         # Owner is allowed
00279         self.failUnless(checkPerm(ModifyPortalContent, self.doc))
00280         # Member is denied
00281         self.login('member')
00282         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00283         # Reviewer is denied
00284         self.login('reviewer')
00285         self.failIf(checkPerm(ModifyPortalContent, self.doc))
00286         # Anonymous is denied
00287         self.logout()
00288         self.failIf(checkPerm(ModifyPortalContent, self.doc))

Here is the call graph for this function:

Definition at line 351 of file test_plone_workflow.py.

00351 
00352     def testModifyVisibleEvent(self):
00353         # Owner is allowed
00354         self.failUnless(checkPerm(ChangeEvents, self.ev))
00355         # Member is denied
00356         self.login('member')
00357         self.failIf(checkPerm(ChangeEvents, self.ev))
00358         # Reviewer is denied
00359         self.login('reviewer')
00360         self.failIf(checkPerm(ChangeEvents, self.ev))
00361         # Anonymous is denied
00362         self.logout()
00363         self.failIf(checkPerm(ChangeEvents, self.ev))

Here is the call graph for this function:

Definition at line 483 of file test_plone_workflow.py.

00483 
00484     def testMyWorklist(self):
00485         # When a member has the local Reviewer role, pending
00486         # docs should show up in his worklist.
00487         self.workflow.doActionFor(self.doc, 'submit')
00488         self.doc.manage_addLocalRoles('member', ['Reviewer'])
00489         self.login('reviewer')
00490         worklist = self.portal.my_worklist()
00491         self.failUnless(len(worklist) == 1)
00492         self.failUnless(worklist[0] == self.doc)
00493         self.login('member')
00494         worklist = self.portal.my_worklist()
00495         self.failUnless(len(worklist) == 1)
00496         self.failUnless(worklist[0] == self.doc)

Here is the call graph for this function:

Definition at line 39 of file test_plone_workflow.py.

00039 
00040     def testOwnerHidesVisibleDocument(self):
00041         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'visible')
00042         self.workflow.doActionFor(self.doc, 'hide')
00043         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'private')
00044         self.failUnless(self.catalog(id='doc', review_state='private'))

Definition at line 107 of file test_plone_workflow.py.

00107 
00108     def testOwnerPublishesVisibleDocument(self):
00109         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'visible')
00110         self.assertRaises(WorkflowException, self.workflow.doActionFor, self.doc, 'publish')

Definition at line 58 of file test_plone_workflow.py.

00058 
00059     def testOwnerRetractsPendingDocument(self):
00060         self.workflow.doActionFor(self.doc, 'submit')
00061         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'pending')
00062         self.workflow.doActionFor(self.doc, 'retract')
00063         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'visible')
00064         self.failUnless(self.catalog(id='doc', review_state='visible'))

Definition at line 65 of file test_plone_workflow.py.

00065 
00066     def testOwnerRetractsPublishedDocument(self):
00067         self.login('reviewer')
00068         self.workflow.doActionFor(self.doc, 'publish')
00069         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'published')
00070         self.login(default_user)
00071         self.workflow.doActionFor(self.doc, 'retract')
00072         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'visible')
00073         self.failUnless(self.catalog(id='doc', review_state='visible'))

Here is the call graph for this function:

Definition at line 45 of file test_plone_workflow.py.

00045 
00046     def testOwnerShowsPrivateDocument(self):
00047         self.workflow.doActionFor(self.doc, 'hide')
00048         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'private')
00049         self.workflow.doActionFor(self.doc, 'show')
00050         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'visible')
00051         self.failUnless(self.catalog(id='doc', review_state='visible'))

Definition at line 111 of file test_plone_workflow.py.

00111 
00112     def testOwnerSubmitsPrivateDocument(self):
00113         self.workflow.doActionFor(self.doc, 'hide')
00114         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'private')
00115         self.assertRaises(WorkflowException, self.workflow.doActionFor, self.doc, 'submit')

Definition at line 52 of file test_plone_workflow.py.

00052 
00053     def testOwnerSubmitsVisibleDocument(self):
00054         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'visible')
00055         self.workflow.doActionFor(self.doc, 'submit')
00056         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'pending')
00057         self.failUnless(self.catalog(id='doc', review_state='pending'))

Definition at line 74 of file test_plone_workflow.py.

00074 
00075     def testReviewerPublishesPendingDocument(self):
00076         self.workflow.doActionFor(self.doc, 'submit')
00077         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'pending')
00078         self.login('reviewer')
00079         self.workflow.doActionFor(self.doc, 'publish')
00080         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'published')
00081         self.failUnless(self.catalog(id='doc', review_state='published'))

Here is the call graph for this function:

Definition at line 90 of file test_plone_workflow.py.

00090 
00091     def testReviewerPublishesVisibleDocument(self):
00092         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'visible')
00093         self.login('reviewer')
00094         self.workflow.doActionFor(self.doc, 'publish')
00095         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'published')
00096         self.failUnless(self.catalog(id='doc', review_state='published'))

Here is the call graph for this function:

Definition at line 82 of file test_plone_workflow.py.

00082 
00083     def testReviewerRejectsPendingDocument(self):
00084         self.workflow.doActionFor(self.doc, 'submit')
00085         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'pending')
00086         self.login('reviewer')
00087         self.workflow.doActionFor(self.doc, 'reject')
00088         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'visible')
00089         self.failUnless(self.catalog(id='doc', review_state='visible'))

Here is the call graph for this function:

Definition at line 97 of file test_plone_workflow.py.

00097 
00098     def testReviewerRejectsPublishedDocument(self):
00099         self.login('reviewer')
00100         self.workflow.doActionFor(self.doc, 'publish')
00101         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'published')
00102         self.workflow.doActionFor(self.doc, 'reject')
00103         self.assertEqual(self.workflow.getInfoFor(self.doc, 'review_state'), 'visible')
00104         self.failUnless(self.catalog(id='doc', review_state='visible'))

Here is the call graph for this function:

Definition at line 497 of file test_plone_workflow.py.

00497 
00498     def testStateTitles(self):
00499         state_titles = { 'private': 'Private',
00500                         'visible': 'Public draft',
00501                         'pending': 'Pending review',
00502                         'published': 'Published'
00503                         }
00504 
00505         wf = self.workflow.plone_workflow
00506             
00507         for state_id, title in state_titles.items():
00508             state = getattr(wf.states, state_id, None)
00509             if state is not None:
00510                 self.assertEqual(state.title, title)
00511 

Definition at line 174 of file test_plone_workflow.py.

00174 
00175     def testViewIsNotAcquiredInPendingState(self):
00176         self.workflow.doActionFor(self.doc, 'submit')
00177         self.assertEqual(self.doc.acquiredRolesAreUsedBy(View), '')

Definition at line 156 of file test_plone_workflow.py.

00156 
00157     def testViewIsNotAcquiredInPrivateState(self):
00158         self.workflow.doActionFor(self.doc, 'hide')
00159         self.assertEqual(self.doc.acquiredRolesAreUsedBy(View), '')

Definition at line 194 of file test_plone_workflow.py.

00194 
00195     def testViewIsNotAcquiredInPublishedState(self):
00196         self.login('reviewer')
00197         self.workflow.doActionFor(self.doc, 'publish')
00198         self.assertEqual(self.doc.acquiredRolesAreUsedBy(View), '')

Here is the call graph for this function:

Definition at line 139 of file test_plone_workflow.py.

00139 
00140     def testViewIsNotAcquiredInVisibleState(self):
00141         self.assertEqual(self.doc.acquiredRolesAreUsedBy(View), '')

Definition at line 160 of file test_plone_workflow.py.

00160 
00161     def testViewPendingDocument(self):
00162         self.workflow.doActionFor(self.doc, 'submit')
00163         # Owner is allowed
00164         self.failUnless(checkPerm(View, self.doc))
00165         # Member is allowed (TODO:?)
00166         self.login('member')
00167         self.failUnless(checkPerm(View, self.doc))
00168         # Reviewer is allowed
00169         self.login('reviewer')
00170         self.failUnless(checkPerm(View, self.doc))
00171         # Anonymous is allowed (TODO:?)
00172         self.logout()
00173         self.failUnless(checkPerm(View, self.doc))

Here is the call graph for this function:

Definition at line 142 of file test_plone_workflow.py.

00142 
00143     def testViewPrivateDocument(self):
00144         self.workflow.doActionFor(self.doc, 'hide')
00145         # Owner is allowed
00146         self.failUnless(checkPerm(View, self.doc))
00147         # Member is denied
00148         self.login('member')
00149         self.failIf(checkPerm(View, self.doc))
00150         # Reviewer is denied
00151         self.login('reviewer')
00152         self.failIf(checkPerm(View, self.doc))
00153         # Anonymous is denied
00154         self.logout()
00155         self.failIf(checkPerm(View, self.doc))

Here is the call graph for this function:

Definition at line 178 of file test_plone_workflow.py.

00178 
00179     def testViewPublishedDocument(self):
00180         self.login('reviewer')
00181         self.workflow.doActionFor(self.doc, 'publish')
00182         # Owner is allowed
00183         self.login(default_user)
00184         self.failUnless(checkPerm(View, self.doc))
00185         # Member is allowed
00186         self.login('member')
00187         self.failUnless(checkPerm(View, self.doc))
00188         # Reviewer is allowed
00189         self.login('reviewer')
00190         self.failUnless(checkPerm(View, self.doc))
00191         # Anonymous is allowed
00192         self.logout()
00193         self.failUnless(checkPerm(View, self.doc))

Here is the call graph for this function:

Definition at line 126 of file test_plone_workflow.py.

00126 
00127     def testViewVisibleDocument(self):
00128         # Owner is allowed
00129         self.failUnless(checkPerm(View, self.doc))
00130         # Member is allowed
00131         self.login('member')
00132         self.failUnless(checkPerm(View, self.doc))
00133         # Reviewer is allowed
00134         self.login('reviewer')
00135         self.failUnless(checkPerm(View, self.doc))
00136         # Anonymous is allowed
00137         self.logout()
00138         self.failUnless(checkPerm(View, self.doc))

Here is the call graph for this function:


Member Data Documentation

Definition at line 22 of file test_plone_workflow.py.

Definition at line 32 of file test_plone_workflow.py.

Definition at line 35 of file test_plone_workflow.py.

Definition at line 23 of file test_plone_workflow.py.


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