Commit 40246311 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

expand test_041_BusinessTemplateWithWorkflowRemoved to check if workflow chain...

expand test_041_BusinessTemplateWithWorkflowRemoved to check if workflow chain is well updated after removing a workflow.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33621 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b4ee3766
...@@ -107,8 +107,12 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -107,8 +107,12 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
props = {} props = {}
if cbt is not None: if cbt is not None:
for id, wf_ids in cbt.items(): for id, wf_ids in cbt.items():
wf_ids = list(wf_ids)
if 'geek_workflow' in wf_ids:
wf_ids.remove('geek_workflow')
if id != "Geek Object": if id != "Geek Object":
props['chain_%s' % id] = ', '.join(wf_ids) props['chain_%s' % id] = ', '.join(wf_ids)
pw.manage_changeWorkflows('', props=props) pw.manage_changeWorkflows('', props=props)
if 'erp5_geek' in self.getSkinsTool().objectIds(): if 'erp5_geek' in self.getSkinsTool().objectIds():
self.getSkinsTool().manage_delObjects(['erp5_geek']) self.getSkinsTool().manage_delObjects(['erp5_geek'])
...@@ -1186,6 +1190,34 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -1186,6 +1190,34 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
props['chain_Geek Object'] = wf_id props['chain_Geek Object'] = wf_id
pw.manage_changeWorkflows('', props=props) pw.manage_changeWorkflows('', props=props)
def stepModifyWorkflowChain(self, sequence=None, sequence_list=None, **kw):
"""
Modify the workflow chain not by business template installation
"""
wf_id = 'geek_workflow'
pw = self.getWorkflowTool()
workflow = pw._getOb(wf_id, None)
self.failUnless(workflow is not None)
cbt = pw._chains_by_type
props = {}
if cbt is not None:
for id, wf_ids in cbt.items():
props['chain_%s' % id] = ','.join(wf_ids)
props['chain_Base Category'] = 'edit_workflow,%s' % wf_id
pw.manage_changeWorkflows('', props=props)
def stepSaveWorkflowChain(self, sequence=None, sequence_list=None, **kw):
"""
Save the workflow chain as it is
"""
pw = self.getWorkflowTool()
cbt = pw._chains_by_type
props = {}
if cbt is not None:
for id, wf_ids in cbt.items():
props['chain_%s' % id] = ','.join(wf_ids)
pw.manage_changeWorkflows('', props=props)
def stepCheckWorkflowChainRemoved(self, sequence=None, sequence_list=None, **kw): def stepCheckWorkflowChainRemoved(self, sequence=None, sequence_list=None, **kw):
""" """
Check if the workflowChain has been removed Check if the workflowChain has been removed
...@@ -1244,7 +1276,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -1244,7 +1276,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
if cbt is not None: if cbt is not None:
for id, wf_ids in cbt.items(): for id, wf_ids in cbt.items():
wf_ids = list(wf_ids) wf_ids = list(wf_ids)
if id == "Geek Object": if wf_id in wf_ids:
wf_ids.remove(wf_id) wf_ids.remove(wf_id)
props['chain_%s' % id] = ','.join(wf_ids) props['chain_%s' % id] = ','.join(wf_ids)
pw.manage_changeWorkflows('', props=props) pw.manage_changeWorkflows('', props=props)
...@@ -2933,6 +2965,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -2933,6 +2965,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CheckBuiltBuildingState \ CheckBuiltBuildingState \
CheckNotInstalledInstallationState \ CheckNotInstalledInstallationState \
InstallBusinessTemplate \ InstallBusinessTemplate \
ModifyWorkflowChain \
Tic \ Tic \
CheckInstalledInstallationState \ CheckInstalledInstallationState \
CheckBuiltBuildingState \ CheckBuiltBuildingState \
...@@ -2964,6 +2997,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -2964,6 +2997,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CheckSkinsLayers \ CheckSkinsLayers \
CheckWorkflowRemoved \ CheckWorkflowRemoved \
CheckWorkflowChainRemoved \ CheckWorkflowChainRemoved \
SaveWorkflowChain \
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
......
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