Commit 8abe46e4 authored by iv's avatar iv

ERP5Workflow: add permission/roles acquisition testing

parent ea6373d7
......@@ -262,17 +262,27 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
self.logMessage(" Verify permission roles dict on 'current' state")
permission_roles_dict = workflow.state_current\
.getStatePermissionRolesDict()
self.tic()
self.assertIn(permission, permission_roles_dict)
self.logMessage(" Change roles for '" + permission +
"' on state and update role list for permission ")
"' on state and update role list for permission")
permission_roles_dict[permission] = ['Assignor']
workflow.state_current.setAcquirePermissionList([])
workflow.updateRoleMappingsFor(text_document)
self.tic()
self.logMessage(" Check document permissions/roles mapping was updated "
+ "(it should be a tuple, as there is no acquisition)")
self.assertEqual(getattr(text_document, permission_key), ('Assignor',))
self.logMessage(" Configure acquisition for '" + permission +
"' on state and update role list for permission")
workflow.state_current.setAcquirePermissionList([permission])
workflow.updateRoleMappingsFor(text_document)
self.tic()
self.logMessage(" Check document permissions/roles mapping was updated")
self.logMessage(" Check document permissions/roles mapping is now" +
" a list (acquisition)")
self.assertEqual(getattr(text_document, permission_key), ['Assignor'])
self.logMessage(" Restore original configuration")
......
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