Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.contentmenu.tests.TestWorkflowMenu Class Reference

List of all members.

Public Member Functions

def afterSetUp
def testMenuImplementsIBrowserMenu
def testMenuImplementsIActionsMenu
def testMenuIncludesActions
def testNoTransitions
def testLockedItem
def testAdvancedIncluded
def testPolicyIncludedIfCMFPWIsInstalled

Public Attributes

 menu
 request

Detailed Description

Definition at line 288 of file tests.py.


Member Function Documentation

Definition at line 290 of file tests.py.

00290 
00291     def afterSetUp(self):
00292         self.folder.invokeFactory('Document', 'doc1')
00293         self.menu = getUtility(IBrowserMenu, name='plone_contentmenu_workflow', context=self.folder)
00294         self.request = self.app.REQUEST

Definition at line 335 of file tests.py.

00335 
00336     def testAdvancedIncluded(self):
00337         actions = self.menu.getMenuItems(self.folder.doc1, self.request)
00338         url = self.folder.doc1.absolute_url() + '/content_status_history'
00339         self.failUnless(url in [a['action'] for a in actions])

Definition at line 326 of file tests.py.

00326 
00327     def testLockedItem(self):
00328         membership_tool = getToolByName(self.folder, 'portal_membership')
00329         membership_tool.addMember('anotherMember', 'secret', ['Member'], [])
00330         locking = ILockable(self.folder.doc1)
00331         locking.lock()
00332         self.login('anotherMember')
00333         actions = self.menu.getMenuItems(self.folder.doc1, self.request)
00334         self.assertEqual(len(actions), 0)

Here is the call graph for this function:

Definition at line 298 of file tests.py.

00298 
00299     def testMenuImplementsIActionsMenu(self):
00300         self.failUnless(IWorkflowMenu.providedBy(self.menu))

Definition at line 295 of file tests.py.

00295 
00296     def testMenuImplementsIBrowserMenu(self):
00297         self.failUnless(IBrowserMenu.providedBy(self.menu))

Definition at line 301 of file tests.py.

00301 
00302     def testMenuIncludesActions(self):
00303         actions = self.menu.getMenuItems(self.folder.doc1, self.request)
00304         self.failUnless('workflow-transition-submit' in
00305                         [a['extra']['id'] for a in actions])
00306         self.failUnless('http://nohost/plone/Members/test_user_1_/doc1/content_status_modify?workflow_action=submit' in
00307                         [a['action'] for a in actions])
00308 
00309         # Let us try that again but with an empty url action, like is
00310         # usual in older workflows, and which is nice to keep
00311         # supporting.
00312         context = self.folder.doc1
00313         wf_tool = getToolByName(context, "portal_workflow")
00314         submit = wf_tool.plone_workflow.transitions['submit']
00315         submit.actbox_url = ""
00316         actions = self.menu.getMenuItems(self.folder.doc1, self.request)
00317         self.failUnless('workflow-transition-submit' in
00318                         [a['extra']['id'] for a in actions])
00319         self.failUnless('http://nohost/plone/Members/test_user_1_/doc1/content_status_modify?workflow_action=submit' in
00320                         [a['action'] for a in actions])

Here is the call graph for this function:

Definition at line 321 of file tests.py.

00321 
00322     def testNoTransitions(self):
00323         self.logout()
00324         actions = self.menu.getMenuItems(self.folder.doc1, self.request)
00325         self.assertEqual(len(actions), 0)

Here is the call graph for this function:

Definition at line 340 of file tests.py.

00340 
00341     def testPolicyIncludedIfCMFPWIsInstalled(self):
00342         actions = self.menu.getMenuItems(self.folder.doc1, self.request)
00343         url = self.folder.doc1.absolute_url() + '/placeful_workflow_configuration'
00344         self.failIf(url in [a['action'] for a in actions])
00345         self.portal.portal_quickinstaller.installProduct('CMFPlacefulWorkflow')
00346         actions = self.menu.getMenuItems(self.folder.doc1, self.request)
00347         self.failUnless(url in [a['action'] for a in actions])
00348 


Member Data Documentation

Definition at line 292 of file tests.py.

Definition at line 293 of file tests.py.


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