Commit e67a0908 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

erp5_core_test: add a test for unconfigured Workflow State permissions.

parent 16882293
Pipeline #34988 failed with stage
in 0 seconds
...@@ -148,6 +148,47 @@ class TestERP5Workflow(ERP5TypeTestCase): ...@@ -148,6 +148,47 @@ class TestERP5Workflow(ERP5TypeTestCase):
self.assertEqual(workflow.getCurrentStatusDict(doc)['variable1'], None) self.assertEqual(workflow.getCurrentStatusDict(doc)['variable1'], None)
def test_WorkflowVariables(self):
workflow = self.workflow_module.newContent(
portal_type='Workflow',
)
workflow.setReference('wf')
permission_list = [
'Access contents information',
'Modify portal content',
'View',
]
workflow.setWorkflowManagedPermissionList(
permission_list
)
state1 = workflow.newContent(portal_type='Workflow State',
title='State 1')
state1.setReference('state1')
workflow.setSourceValue(state1)
self.assertEqual(
state1.getAcquirePermissionList(),
permission_list,
)
self.assertEqual(
state1.getStatePermissionRoleListDict(),
{k: () for k in permission_list},
)
state1.setStatePermissionRoleListDict(
{k: ['Assignor', 'Manager'] for k in permission_list},
)
workflow.setWorkflowManagedPermissionList(
permission_list + ['Delete objects']
)
self.assertEqual(
state1.getStatePermissionRoleListDict(),
{
'Access contents information': ('Assignor', 'Manager'),
'Delete objects': (),
'Modify portal content': ('Assignor', 'Manager'),
'View': ('Assignor', 'Manager'),
},
)
def test_afterScript(self): def test_afterScript(self):
workflow = self.workflow_module.newContent( workflow = self.workflow_module.newContent(
......
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