Logo Search packages:      
Sourcecode: zope-cmfplacefulworkflow version File versions  Download package

def CMFPlacefulWorkflow::tests::testCMFPlacefulWorkflow::TestPlacefulWorkflow::test_16_getWorklists (   self )
Verify if worklists are always accessible with a policy

Definition at line 559 of file testCMFPlacefulWorkflow.py.

                                  :
        """Verify if worklists are always accessible with a policy
        """
        wf_tool = self.portal.portal_workflow
        placeful_tool = self.portal_placeful_workflow

        self.loginAsPortalOwner()

        self.portal.invokeFactory('Folder', id='folder')
        self.portal.folder.invokeFactory('Document', id='document')

        # Create a policy
        placeful_tool.manage_addWorkflowPolicy('foo_bar_policy',
                                               'default_workflow_policy (Simple Policy)',
                                               'portal_workflow',)
        # And redefine the chain for Document in portal_workflow
        wf_tool.setChainForPortalTypes(['Document'], ())

        # Add a config to the folder using the policy
        self.portal.folder.manage_addProduct['CMFPlacefulWorkflow'].manage_addWorkflowPolicyConfig()

        # Set the policy for the config
        config = getattr(self.portal.folder, WorkflowPolicyConfig_id)
        config.setPolicyBelow('foo_bar_policy')

        # we make the document pending
        document = self.portal.folder.document
        wf_tool.doActionFor(document, 'submit', comment="unittest transition")

        self.assertEqual(tuple(wf_tool.getWorklists().keys()), ('folder_workflow', 'plone_workflow'))
        self.assertEqual(tuple(self.portal.my_worklist()), (document,))

        self.logout()



Generated by  Doxygen 1.6.0   Back to index