Commit 6ae8fc6b authored by wenjie.zheng's avatar wenjie.zheng

erp5_workflow: change the test name from testerp5anddcworkflow to...

erp5_workflow: change the test name from testerp5anddcworkflow to testWorkflowAndDCWorkflow and the ERP5Workflow Test Object to ERP5Workflow Test Document, replace a _getOb in test script.
parent 029c1a0a
...@@ -6,8 +6,7 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase): ...@@ -6,8 +6,7 @@ class TestERP5WorkflowMixin(ERP5TypeTestCase):
def getTestObject(self): def getTestObject(self):
self.portal = self.getPortal() self.portal = self.getPortal()
type_test_object = self.portal.portal_types._getOb('ERP5Workflow Test Object') test_object = self.portal.erp5workflow_test_module.newContent(portal_type='ERP5Workflow Test Document')
test_object = self.portal.erp5workflow_test_module.newContent(portal_type='ERP5Workflow Test Object')
return test_object return test_object
def doActionFor(): def doActionFor():
...@@ -82,10 +81,10 @@ class TestERP5Workflow(TestERP5WorkflowMixin): ...@@ -82,10 +81,10 @@ class TestERP5Workflow(TestERP5WorkflowMixin):
""" """
def afterSetUp(self): def afterSetUp(self):
self.portal = self.getPortal() self.portal = self.getPortal()
self.getWorkflowTool().setChainForPortalTypes(['ERP5Workflow Test Object'], ()) self.getWorkflowTool().setChainForPortalTypes(['ERP5Workflow Test Document'], ())
self.workflow_module = self.portal.workflow_module self.workflow_module = self.portal.workflow_module
self.wf = self.workflow_module._getOb('erp5_validation_workflow') self.wf = self.workflow_module._getOb('erp5_validation_workflow')
type_test_object = self.portal.portal_types._getOb('ERP5Workflow Test Object') type_test_object = self.portal.portal_types._getOb('ERP5Workflow Test Document')
type_test_object.edit(type_base_category_list=('validation_state',)) type_test_object.edit(type_base_category_list=('validation_state',))
type_test_object.edit(type_erp5workflow_list=('erp5_validation_workflow',)) type_test_object.edit(type_erp5workflow_list=('erp5_validation_workflow',))
self.resetComponentTool() self.resetComponentTool()
...@@ -95,6 +94,7 @@ class TestERP5Workflow(TestERP5WorkflowMixin): ...@@ -95,6 +94,7 @@ class TestERP5Workflow(TestERP5WorkflowMixin):
# check dc_test_workflow is not in use # check dc_test_workflow is not in use
self.assertFalse('dc_test_workflow' in self.getWorkflowTool().getChainFor(document.getTypeInfo().getId())) self.assertFalse('dc_test_workflow' in self.getWorkflowTool().getChainFor(document.getTypeInfo().getId()))
getattr(document, convertToMixedCase(action))() getattr(document, convertToMixedCase(action))()
#self.wf.doActionFor(document, action)
def getStateFor(self, document): def getStateFor(self, document):
return getattr(document, 'getValidationState')() return getattr(document, 'getValidationState')()
...@@ -107,9 +107,9 @@ class TestDCWorkflow(TestERP5WorkflowMixin): ...@@ -107,9 +107,9 @@ class TestDCWorkflow(TestERP5WorkflowMixin):
# make sure erp5 workflow list is empty # make sure erp5 workflow list is empty
self.portal = self.getPortal() self.portal = self.getPortal()
self.workflow_module = self.portal.portal_workflow self.workflow_module = self.portal.portal_workflow
self.getWorkflowTool().setChainForPortalTypes(['ERP5Workflow Test Object'], ('dc_test_workflow')) self.getWorkflowTool().setChainForPortalTypes(['ERP5Workflow Test Document'], ('dc_test_workflow'))
self.wf = self.workflow_module._getOb('dc_test_workflow') self.wf = self.workflow_module._getOb('dc_test_workflow')
type_test_object = self.portal.portal_types._getOb('ERP5Workflow Test Object') type_test_object = self.portal.portal_types._getOb('ERP5Workflow Test Document')
type_test_object.edit(type_base_category_list=()) type_test_object.edit(type_base_category_list=())
type_test_object.edit(type_erp5workflow_list=()) type_test_object.edit(type_erp5workflow_list=())
self.resetComponentTool() self.resetComponentTool()
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>testERP5andDCWorkflow</string> </value> <value> <string>testWorkflowAndDCWorkflow</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>test.erp5.testerp5anddcworkflow</string> </value> <value> <string>test.erp5.testWorkflowAndDCWorkflow</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
......
test.erp5.testWorkflow5Method test.erp5.testWorkflow5Method
test.erp5.testerp5anddcworkflow test.erp5.testWorkflowAndDCWorkflow
\ No newline at end of file \ No newline at end of file
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