Commit 1b285dc8 authored by iv's avatar iv

ERP5Workflow: change testWorklist to check new guards properties

parent 8778072e
...@@ -492,24 +492,22 @@ class TestWorklist(testWorkflowMixin): ...@@ -492,24 +492,22 @@ class TestWorklist(testWorkflowMixin):
worklist_value = getattr(workflow_value, 'worklist_%s' % worklist_id) worklist_value = getattr(workflow_value, 'worklist_%s' % worklist_id)
# roles # roles
worklist_value.setGuardRoleList([]) worklist_value.setGuardRoleList([])
self.assertEqual([], worklist_value.guard.roles) self.assertEqual(worklist_value.guard_role, ())
worklist_value.setGuardRoleList(['Assignor', 'Assignee']) worklist_value.setGuardRoleList(['Assignor', 'Assignee'])
self.assertEqual(['Assignor', 'Assignee'], worklist_value.guard.roles) self.assertEqual(worklist_value.guard_role, ('Assignor', 'Assignee'))
# permissions # permissions
worklist_value.setGuardPermissionList([]) worklist_value.setGuardPermissionList([])
self.assertEqual([], worklist_value.guard.permissions) self.assertEqual(worklist_value.guard_permission, ())
worklist_value.setGuardPermissionList(['Modify portal content']) worklist_value.setGuardPermissionList(['Modify portal content'])
self.assertEqual(['Modify portal content'], worklist_value.guard.permissions) self.assertEqual(worklist_value.guard_permission, ('Modify portal content',))
# groups # groups
worklist_value.setGuardGroupList([]) worklist_value.setGuardGroupList([])
self.assertEqual([], worklist_value.guard.groups) self.assertEqual(worklist_value.guard_group, ())
worklist_value.setGuardGroupList(['Group1', 'Group2']) worklist_value.setGuardGroupList(['Group1', 'Group2'])
self.assertEqual(['Group1', 'Group2'], worklist_value.guard.groups) self.assertEqual(worklist_value.guard_group, ('Group1', 'Group2'))
# expression # expression
worklist_value.setGuardExpression('')
self.assertEqual(None, worklist_value.guard.expr)
worklist_value.setGuardExpression('python: "Hello, world"') worklist_value.setGuardExpression('python: "Hello, world"')
self.assertEqual(worklist_value.guard.expr.text, 'python: "Hello, world"') self.assertEqual(worklist_value.guard_expression.text, 'python: "Hello, world"')
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
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