Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testContentTypeScripts.TestWorkflowHistory Class Reference
Inheritance diagram for CMFPlone.tests.testContentTypeScripts.TestWorkflowHistory:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testContentTypeScripts.TestWorkflowHistory:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_WorkflowHistory
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 doc
 wf

Detailed Description

Definition at line 408 of file testContentTypeScripts.py.


Member Function Documentation

Definition at line 410 of file testContentTypeScripts.py.

00410 
00411     def afterSetUp(self):
00412         self.folder.invokeFactory('Document',id='doc')
00413         self.doc = self.folder.doc
00414         self.wf = self.portal.portal_workflow

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 415 of file testContentTypeScripts.py.

00415 
00416     def test_WorkflowHistory(self):
00417         # see if doc returns any history at this point
00418         history = self.doc.getWorkflowHistory()
00419         self.failUnlessEqual(history, [])
00420 
00421         # do a transition
00422         self.setRoles(['Reviewer']) # has no modify portal content permission
00423         self.wf.doActionFor(self.doc, 'publish')
00424         self.wf.doActionFor(self.doc, 'retract')
00425         self.wf.doActionFor(self.doc, 'publish')
00426         history = self.doc.getWorkflowHistory()
00427 
00428         # should return no history: no edit permission
00429         self.failUnlessEqual([],[])
00430 
00431         # give edit permissions.
00432         self.doc.manage_permission('Modify portal content', ['Reviewer'], acquire=0)
00433         # should return the history list
00434         history = self.doc.getWorkflowHistory()
00435         self.failUnlessEqual(history[0]['action'], 'publish')
00436         self.failUnlessEqual(history[1]['action'], 'retract')
00437         self.failUnlessEqual(history[2]['action'], 'publish')
00438 

Here is the call graph for this function:


Member Data Documentation

Definition at line 412 of file testContentTypeScripts.py.

Definition at line 413 of file testContentTypeScripts.py.


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