Commit 3b35b535 authored by wenjie.zheng's avatar wenjie.zheng

ERP5TypeTestCase.py: avoid using accessor in dynamicWorkflowConversion. also...

ERP5TypeTestCase.py: avoid using accessor in dynamicWorkflowConversion. also put self.commit() back.
parent 427d354d
......@@ -31,6 +31,7 @@ from DateTime import DateTime
# XXX make sure that get_request works.
import Products.ERP5Type.Utils
from Products.ERP5Type import Globals
from Products.ERP5.Tool.WorkflowTool import WorkflowTool
# store a copy of the original method
original_get_request = Globals.get_request
......@@ -926,9 +927,9 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
def dynamicWorkflowConversion(self):
# Converting DCWorkflow dynamically
workflow_tool = self.portal._getOb('portal_workflow', None)
workflow_tool = self.portal.portal_workflow
type_value_list = []
if workflow_tool and workflow_tool.getPortalType() == "Workflow Tool":
if workflow_tool and isinstance(workflow_tool, WorkflowTool):
type_workflow_dict = workflow_tool.getChainsByType()
for workflow_id in workflow_tool.objectIds():
start = DateTime()
......@@ -962,6 +963,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
# Reset the original workflows assignement order.
for type_value in type_value_list:
type_value.workflow_list = tuple(reversed(type_value.workflow_list))
self.commit()
def setUpERP5Site(self,
business_template_list=(),
......
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