Commit e35761e6 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_core_test: test multi local role worklist

parent 0c945082
......@@ -545,3 +545,44 @@ class TestWorklist(TestWorkflowMixin):
finally:
self.removeWorklist(self.checked_workflow, ['region_worklist'])
def test_05_worklist_for_multiple_local_role(self, quiet=0, run=run_all_test):
if not run:
return
workflow_tool = self.getWorkflowTool()
self.createManagerAndLogin()
self.createUsers()
self.logMessage("Create worklists with multiple local roles")
self.createWorklist(self.checked_workflow,
'assignor_or_assignee_worklist',
'assignor or assignee can view',
portal_type=self.checked_portal_type,
validation_state='validated',
guard_roles="Assignor; Assignee")
try:
document = self.createDocument()
document.manage_addLocalRoles("bar", ["Assignor"])
document.manage_addLocalRoles("foo", ["Assignee"])
document.validate()
document.reindexObject()
self.tic()
self.clearCache()
self.logMessage(" Check that user bar can access worklist")
self.loginByUserName('bar')
result = workflow_tool.listActions(object=document)
self.checkWorklist(result, 'assignor_or_assignee_worklist', 1)
self.logMessage(" Check that user foo can access worklist")
self.loginByUserName('foo')
result = workflow_tool.listActions(object=document)
self.checkWorklist(result, 'assignor_or_assignee_worklist', 1)
finally:
self.removeWorklist(self.checked_workflow,
['assignor_or_assignee_worklist'])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment