Commit 46bca9e5 authored by iv's avatar iv

ERP5Workflow: fix test on worklists to use new action_xxx instead of actbox_xxx

parent 3b58467c
...@@ -13,17 +13,17 @@ class TestWorklist(testWorkflowMixin): ...@@ -13,17 +13,17 @@ class TestWorklist(testWorkflowMixin):
test_worklist_dict = { test_worklist_dict = {
'assignor_worklist': 'assignor_worklist':
{'actbox_name': 'assignor_todo', 'role': 'Assignor', 'expr': None, 'state': 'draft', 'int_variable': None}, {'action_name': 'assignor_todo', 'role': 'Assignor', 'expr': None, 'state': 'draft', 'int_variable': None},
'owner_worklist': 'owner_worklist':
{'actbox_name': 'owner_todo', 'role': 'Owner', 'expr': None, 'state': 'draft', 'int_variable': None}, {'action_name': 'owner_todo', 'role': 'Owner', 'expr': None, 'state': 'draft', 'int_variable': None},
'owner_worklist_desactivated': 'owner_worklist_desactivated':
{'actbox_name':'owner_todo_desactivated', 'role': 'Owner', 'expr': 'python: 0', 'state': 'draft', 'int_variable': None}, {'action_name':'owner_todo_desactivated', 'role': 'Owner', 'expr': 'python: 0', 'state': 'draft', 'int_variable': None},
'owner_worklist_wrong_state': 'owner_worklist_wrong_state':
{'actbox_name':'owner_todo_wrong_state', 'role': 'Owner', 'expr': None, 'state': 'not_draft', 'int_variable': None}, {'action_name':'owner_todo_wrong_state', 'role': 'Owner', 'expr': None, 'state': 'not_draft', 'int_variable': None},
'assignor_owner_worklist': 'assignor_owner_worklist':
{'actbox_name':'assignor_owner_todo', 'role': 'Assignor ; Owner','expr': None, 'state': 'draft', 'int_variable': None}, {'action_name':'assignor_owner_todo', 'role': 'Assignor ; Owner','expr': None, 'state': 'draft', 'int_variable': None},
'int_value_worklist': 'int_value_worklist':
{'actbox_name':'int_value_todo', 'role': None, 'expr': None, 'state': None, 'int_variable': str(1)} {'action_name':'int_value_todo', 'role': None, 'expr': None, 'state': None, 'int_variable': str(1)}
} }
...@@ -121,10 +121,10 @@ class TestWorklist(testWorkflowMixin): ...@@ -121,10 +121,10 @@ class TestWorklist(testWorkflowMixin):
else: else:
self.createDCWorklist(workflow_value, *args, **kw) self.createDCWorklist(workflow_value, *args, **kw)
def createERP5Worklist(self, workflow_value, worklist_id, actbox_name, def createERP5Worklist(self, workflow_value, worklist_id, action_name,
actbox_url=None, portal_type=None, validation_state=None, action=None, portal_type=None, validation_state=None,
guard_roles='', guard_expr=None, **kw): guard_roles='', guard_expr=None, **kw):
actbox_name='%s (%%(count)s)' % actbox_name action_name='%s (%%(count)s)' % action_name
if workflow_value.__class__.__name__ == 'Workflow': if workflow_value.__class__.__name__ == 'Workflow':
if getattr(workflow_value, worklist_id, None): if getattr(workflow_value, worklist_id, None):
workflow_value.manage_delObjects([worklist_id]) workflow_value.manage_delObjects([worklist_id])
...@@ -138,9 +138,9 @@ class TestWorklist(testWorkflowMixin): ...@@ -138,9 +138,9 @@ class TestWorklist(testWorkflowMixin):
worklist_value.edit( worklist_value.edit(
reference=worklist_id, reference=worklist_id,
actbox_name=actbox_name, action_name=action_name,
actbox_url=actbox_url, action=action,
actbox_category='global', action_type='global',
matched_validation_state=validation_state, matched_validation_state=validation_state,
matched_portal_type_list=portal_type, matched_portal_type_list=portal_type,
guard_role_list=guard_roles, guard_role_list=guard_roles,
...@@ -154,16 +154,16 @@ class TestWorklist(testWorkflowMixin): ...@@ -154,16 +154,16 @@ class TestWorklist(testWorkflowMixin):
if isinstance(worklist_variable_value, str) and worklist_variable_value.startswith('python'): if isinstance(worklist_variable_value, str) and worklist_variable_value.startswith('python'):
worklist_variable.setVariableExpression(worklist_variable_value) worklist_variable.setVariableExpression(worklist_variable_value)
def createDCWorklist(self, workflow_value, worklist_id, actbox_name, def createDCWorklist(self, workflow_value, worklist_id, action_name,
actbox_url=None, **kw): action=None, **kw):
actbox_name='%s (%%(count)s)' % actbox_name action_name='%s (%%(count)s)' % action_name
worklists = workflow_value.worklists worklists = workflow_value.worklists
if worklists._getOb(worklist_id, None): if worklists._getOb(worklist_id, None):
worklists.deleteWorklists([worklist_id]) worklists.deleteWorklists([worklist_id])
worklists.addWorklist(worklist_id) worklists.addWorklist(worklist_id)
worklist_value = worklists._getOb(worklist_id) worklist_value = worklists._getOb(worklist_id)
worklist_value.setProperties('', actbox_name=actbox_name, actbox_url=actbox_url, worklist_value.setProperties('', action_name=action_name, action=action,
props={k if k.startswith('guard_') else 'var_match_' + k: v props={k if k.startswith('guard_') else 'var_match_' + k: v
for k, v in kw.iteritems()}) for k, v in kw.iteritems()})
...@@ -209,7 +209,7 @@ class TestWorklist(testWorkflowMixin): ...@@ -209,7 +209,7 @@ class TestWorklist(testWorkflowMixin):
worklist = self.test_worklist_dict[worklist_id] worklist = self.test_worklist_dict[worklist_id]
self.createWorklist('validation_workflow', self.createWorklist('validation_workflow',
worklist_id, worklist_id,
worklist['actbox_name'], worklist['action_name'],
guard_roles=worklist['role'], guard_roles=worklist['role'],
guard_expr=worklist['expr'], guard_expr=worklist['expr'],
portal_type='Organisation', portal_type='Organisation',
...@@ -447,7 +447,7 @@ class TestWorklist(testWorkflowMixin): ...@@ -447,7 +447,7 @@ class TestWorklist(testWorkflowMixin):
self.createWorklist('validation_workflow', 'region_worklist', self.createWorklist('validation_workflow', 'region_worklist',
'has_semewhere_region', 'has_semewhere_region',
portal_type='Organisation', portal_type='Organisation',
actbox_url='organisation_module?'\ action='organisation_module?'\
'region_uid:list=%(region_uid)s&'\ 'region_uid:list=%(region_uid)s&'\
'portal_type:list=%(portal_type)s&reset:int=1', 'portal_type:list=%(portal_type)s&reset:int=1',
region_uid='python:[str(object.getPortalObject().'\ region_uid='python:[str(object.getPortalObject().'\
......
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