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

def CMFPlacefulWorkflow::tests::testCMFPlacefulWorkflow::TestPlacefulWorkflow::test_11_copy_paste (   self  ) 

Test security after a copy/paste

Definition at line 418 of file testCMFPlacefulWorkflow.py.

00418                                 :
        """ Test security after a copy/paste
        """
        self.logout()
        self.loginAsPortalOwner()
        wft = self.portal.portal_workflow
        self.portal.invokeFactory('Document', id='document')
        self.portal.invokeFactory('Folder', id='folder')

        # Create a policy
        pwt = self.portal_placeful_workflow
        pwt.manage_addWorkflowPolicy('foo_bar_policy',
                                     'default_workflow_policy (Simple Policy)')

        # And redefine the chain for Document
        gsp1 = pwt.getWorkflowPolicyById('foo_bar_policy')
        gsp1.setChainForPortalTypes(['Document'], ['folder_workflow'])

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

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

        # In folder, we want to have folder_workflow
        # We set PolicyIn to the first policy in folder
        pc.setPolicyIn('foo_bar_policy')

        cb = self.portal.manage_copyObjects(['document'])
        self.portal.folder.manage_pasteObjects(cb_copy_data=cb)

        # A document in plone root should have plone_workflow
        chain = wft.getChainFor(self.portal.document)
        self.assertEqual(tuple(chain), ('plone_workflow',))

        # Folder should have folder_workflow
        chain = wft.getChainFor(self.portal.folder)
        self.assertEqual(tuple(chain), ('folder_workflow',))

        # A document in folder should have folder_workflow
        chain = wft.getChainFor(self.portal.folder.document)
        self.assertEqual(tuple(chain), ('folder_workflow',))

    def test_11_getWorkflowPolicyById_edge_cases(self):


Generated by  Doxygen 1.6.0   Back to index