Commit d635f503 authored by wenjie.zheng's avatar wenjie.zheng

erp5_workflow_test_data: in test_simple_worklist, now login as auditor before...

erp5_workflow_test_data: in test_simple_worklist, now login as auditor before create document and checkworklist.
parent a576bc61
...@@ -43,6 +43,9 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase): ...@@ -43,6 +43,9 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
self.assertTrue(parameter in selection_parameter_dict) self.assertTrue(parameter in selection_parameter_dict)
self.assertEqual(value, selection_parameter_dict[parameter]) self.assertEqual(value, selection_parameter_dict[parameter])
def clearCache(self):
self.portal.portal_caches.clearAllCache()
def resetComponentTool(self): def resetComponentTool(self):
# Force reset of portal_components to regenerate accessors # Force reset of portal_components to regenerate accessors
# Since it is already handled by interactions, we only need to commit # Since it is already handled by interactions, we only need to commit
...@@ -153,14 +156,16 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase): ...@@ -153,14 +156,16 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
""" """
check the counter from worklist action_name. check the counter from worklist action_name.
""" """
self.login('test_user_workflow')
self.portal = self.getPortal() self.portal = self.getPortal()
new_object = self.getTestObject() new_object = self.getTestObject()
workflow_tool = self.portal.portal_workflow workflow_tool = self.portal.portal_workflow
self.clearCache()
result = workflow_tool.listActions(object=new_object) new_object.reindexObject()
self.clearCache()
self.logout() result = workflow_tool.listActions(object=new_object)
self.login('test_user_workflow')
self.checkWorklist(result, 'Document', 1) self.checkWorklist(result, 'Document', 1)
...@@ -193,7 +198,7 @@ class TestERP5Workflow(TestERP5WorkflowMixin): ...@@ -193,7 +198,7 @@ class TestERP5Workflow(TestERP5WorkflowMixin):
type_test_object.edit(type_erp5workflow_list=('testing_workflow',)) type_test_object.edit(type_erp5workflow_list=('testing_workflow',))
self.resetComponentTool() self.resetComponentTool()
self.assertFalse('testing_workflow' in self.getWorkflowTool().getChainFor(type_test_object.getId())) self.assertFalse('testing_workflow' in self.getWorkflowTool().getChainFor(type_test_object.getId()))
self.login() self.login() # as Manager
def getStateFor(self, document): def getStateFor(self, document):
return getattr(document, 'getValidationState')() return getattr(document, 'getValidationState')()
......
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