Commit 2998c11b authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

erp5_workflow_test_data: remove self.tic which may crash test; edit portal...

erp5_workflow_test_data: remove self.tic which may crash test; edit portal type's workflow_list directly to not trigger workfow methods at the early stage of test.
parent e8b8b0b3
...@@ -63,7 +63,6 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase): ...@@ -63,7 +63,6 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
# self.assertEqual(new_object.getDescription(), "After script was executed.") # self.assertEqual(new_object.getDescription(), "After script was executed.")
### zwj: mechanism: validate => validate interaction => ### zwj: mechanism: validate => validate interaction =>
### setTitle => setTitle interaction => setDescription ### setTitle => setTitle interaction => setDescription
self.tic()
self.assertEqual(new_object.getDescription(), "Interaction of setTitle executed. setTitle is appeared in after validate script.") self.assertEqual(new_object.getDescription(), "Interaction of setTitle executed. setTitle is appeared in after validate script.")
def test_02_testBeforeScript(self): def test_02_testBeforeScript(self):
...@@ -185,7 +184,6 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase): ...@@ -185,7 +184,6 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
self.assertEqual(new_object.getTitle(), "After validate interaction.") self.assertEqual(new_object.getTitle(), "After validate interaction.")
self.assertEqual(self.getStateFor(new_object), 'validated') self.assertEqual(self.getStateFor(new_object), 'validated')
new_object.setTitle("tictic") new_object.setTitle("tictic")
self.tic()
self.assertEqual(new_object.getDescription(), "Interaction of setTitle executed. setTitle is appeared in after validate script.") self.assertEqual(new_object.getDescription(), "Interaction of setTitle executed. setTitle is appeared in after validate script.")
def test_12_testIsTransitionPossible(self): def test_12_testIsTransitionPossible(self):
...@@ -217,7 +215,7 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin): ...@@ -217,7 +215,7 @@ class TestConvertedWorkflow(TestERP5WorkflowMixin):
dc_wf_id_list = ['testing_workflow', 'testing_interaction_workflow'] dc_wf_id_list = ['testing_workflow', 'testing_interaction_workflow']
# clean the workflow_list assignment # clean the workflow_list assignment
type_test_object = self.portal.portal_types['ERP5Workflow Test Document'] type_test_object = self.portal.portal_types['ERP5Workflow Test Document']
type_test_object.edit(type_workflow_list=()) type_test_object.workflow_list = ()
ptype_id = 'ERP5Workflow Test Document' ptype_id = 'ERP5Workflow Test Document'
type_test_object = self.portal.portal_types._getOb(ptype_id) type_test_object = self.portal.portal_types._getOb(ptype_id)
...@@ -255,7 +253,7 @@ class TestDCWorkflow(TestERP5WorkflowMixin): ...@@ -255,7 +253,7 @@ class TestDCWorkflow(TestERP5WorkflowMixin):
self.getWorkflowTool().setChainForPortalTypes(['ERP5Workflow Test Document'], ('testing_workflow', 'testing_interaction_workflow', 'edit_workflow', )) self.getWorkflowTool().setChainForPortalTypes(['ERP5Workflow Test Document'], ('testing_workflow', 'testing_interaction_workflow', 'edit_workflow', ))
self.wf = self.workflow_module._getOb('testing_workflow') self.wf = self.workflow_module._getOb('testing_workflow')
type_test_object = self.portal.portal_types['ERP5Workflow Test Document'] type_test_object = self.portal.portal_types['ERP5Workflow Test Document']
type_test_object.edit(type_workflow_list=()) type_test_object.workflow_list = ()
self.resetComponentTool() self.resetComponentTool()
self.assertEqual(type_test_object.getTypeWorkflowList(), []) self.assertEqual(type_test_object.getTypeWorkflowList(), [])
self.login() self.login()
......
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