Commit 1fa6ac81 authored by Christophe Dumez's avatar Christophe Dumez

- Fixed some tests

- Added worklow chain uninstall test


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9242 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c1dac5f5
...@@ -94,6 +94,14 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -94,6 +94,14 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
self.getPortal().manage_delObjects(['geek_module']) self.getPortal().manage_delObjects(['geek_module'])
if 'geek_workflow' in self.getWorkflowTool().objectIds(): if 'geek_workflow' in self.getWorkflowTool().objectIds():
self.getWorkflowTool().manage_delObjects(['geek_workflow']) self.getWorkflowTool().manage_delObjects(['geek_workflow'])
pw = self.getWorkflowTool()
cbt = pw._chains_by_type
props = {}
if cbt is not None:
for id, wf_ids in cbt.items():
if id != "Geek Object":
props['chain_%s' % id] = ','.join(wf_ids)
pw.manage_changeWorkflows('', props=props)
get_transaction().commit() get_transaction().commit()
self._ignore_log_errors() self._ignore_log_errors()
...@@ -767,9 +775,19 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -767,9 +775,19 @@ 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():
props['chain_%s' % id] = ','.join(wf_ids) props['chain_%s' % id] = ','.join(wf_ids)
props['chain_geek'] = 'geek_workflow' props['chain_Geek Object'] = 'geek_workflow'
pw.manage_changeWorkflows('', props=props) pw.manage_changeWorkflows('', props=props)
def stepCheckWorkflowChainRemoved(self, sequence=None, sequence_list=None, **kw):
"""
Check if the workflowChain has been removed
"""
pw = self.getWorkflowTool()
cbt = pw._chains_by_type
if cbt is not None:
for id, wf_ids in cbt.items():
self.failUnless(id!="Geek Object")
def stepAddWorkflowToBusinessTemplate(self, sequence=None, sequence_list=None, **kw): def stepAddWorkflowToBusinessTemplate(self, sequence=None, sequence_list=None, **kw):
""" """
Add workflow to business template Add workflow to business template
...@@ -781,6 +799,15 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -781,6 +799,15 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
self.assertEqual(len(wf_ids), 1) self.assertEqual(len(wf_ids), 1)
bt.edit(template_workflow_id_list=wf_ids) bt.edit(template_workflow_id_list=wf_ids)
def stepAddWorkflowChainToBusinessTemplate(self, sequence=None, sequence_list=None, **kw):
"""
Add workflow to business template
"""
bt = sequence.get('current_bt', None)
self.failUnless(bt is not None)
wf_chain_ids = ['Geek Object | %s' % sequence.get('workflow_id', '')]
bt.edit(template_portal_type_workflow_chain_list=wf_chain_ids)
def stepRemoveWorkflow(self, sequence=None, sequence_list=None, **kw): def stepRemoveWorkflow(self, sequence=None, sequence_list=None, **kw):
""" """
Remove Workflow Remove Workflow
...@@ -790,6 +817,14 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -790,6 +817,14 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
pw.manage_delObjects([wf_id]) pw.manage_delObjects([wf_id])
workflow = pw._getOb(wf_id, None) workflow = pw._getOb(wf_id, None)
self.failUnless(workflow is None) self.failUnless(workflow is None)
# remove workflowChain
cbt = pw._chains_by_type
props = {}
if cbt is not None:
for id, wf_ids in cbt.items():
if id != "Geek Object":
props['chain_%s' % id] = ','.join(wf_ids)
pw.manage_changeWorkflows('', props=props)
def stepCheckWorkflowExists(self, sequence=None, sequence_list=None, **kw): def stepCheckWorkflowExists(self, sequence=None, sequence_list=None, **kw):
""" """
...@@ -1498,13 +1533,6 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -1498,13 +1533,6 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
""" """
import_bt = sequence.get('import_bt') import_bt = sequence.get('import_bt')
import_bt.install(force=1) import_bt.install(force=1)
def stepInstallCurrentBusinessTemplate(self, sequence=None, sequence_list=None, **kw):
"""
Install importzed business template
"""
current_bt = sequence.get('current_bt')
current_bt.install(force=1)
def stepCreateNewBusinessTemplate(self, sequence=None, sequence_list=None, **kw): def stepCreateNewBusinessTemplate(self, sequence=None, sequence_list=None, **kw):
""" """
...@@ -1840,6 +1868,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -1840,6 +1868,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CreateNewBusinessTemplate \ CreateNewBusinessTemplate \
UseExportBusinessTemplate \ UseExportBusinessTemplate \
AddWorkflowToBusinessTemplate \ AddWorkflowToBusinessTemplate \
AddWorkflowChainToBusinessTemplate \
CheckModifiedBuildingState \ CheckModifiedBuildingState \
CheckNotInstalledInstallationState \ CheckNotInstalledInstallationState \
BuildBusinessTemplate \ BuildBusinessTemplate \
...@@ -2447,6 +2476,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -2447,6 +2476,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CheckBuiltBuildingState \ CheckBuiltBuildingState \
CheckNotInstalledInstallationState \ CheckNotInstalledInstallationState \
CheckPropertySheetRemoved \ CheckPropertySheetRemoved \
CheckWorkflowChainRemoved \
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
...@@ -2482,6 +2512,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -2482,6 +2512,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
AddBaseCategoryToBusinessTemplate \ AddBaseCategoryToBusinessTemplate \
AddSubCategoriesAsPathToBusinessTemplate \ AddSubCategoriesAsPathToBusinessTemplate \
AddWorkflowToBusinessTemplate \ AddWorkflowToBusinessTemplate \
AddWorkflowChainToBusinessTemplate \
AddCatalogMethodToBusinessTemplate \ AddCatalogMethodToBusinessTemplate \
AddKeysAndTableToBusinessTemplate \ AddKeysAndTableToBusinessTemplate \
AddRoleToBusinessTemplate \ AddRoleToBusinessTemplate \
...@@ -2659,6 +2690,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -2659,6 +2690,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
AddBaseCategoryToBusinessTemplate \ AddBaseCategoryToBusinessTemplate \
AddSubCategoriesAsPathToBusinessTemplate \ AddSubCategoriesAsPathToBusinessTemplate \
AddWorkflowToBusinessTemplate \ AddWorkflowToBusinessTemplate \
AddWorkflowChainToBusinessTemplate \
AddCatalogMethodToBusinessTemplate \ AddCatalogMethodToBusinessTemplate \
AddKeysAndTableToBusinessTemplate \ AddKeysAndTableToBusinessTemplate \
AddRoleToBusinessTemplate \ AddRoleToBusinessTemplate \
...@@ -2782,6 +2814,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -2782,6 +2814,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
AddBaseCategoryToBusinessTemplate \ AddBaseCategoryToBusinessTemplate \
AddSubCategoriesAsPathToBusinessTemplate \ AddSubCategoriesAsPathToBusinessTemplate \
AddWorkflowToBusinessTemplate \ AddWorkflowToBusinessTemplate \
AddWorkflowChainToBusinessTemplate \
AddCatalogMethodToBusinessTemplate \ AddCatalogMethodToBusinessTemplate \
AddKeysAndTableToBusinessTemplate \ AddKeysAndTableToBusinessTemplate \
AddRoleToBusinessTemplate \ AddRoleToBusinessTemplate \
...@@ -2869,6 +2902,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -2869,6 +2902,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
AddBaseCategoryToBusinessTemplate \ AddBaseCategoryToBusinessTemplate \
AddSubCategoriesAsPathToBusinessTemplate \ AddSubCategoriesAsPathToBusinessTemplate \
AddWorkflowToBusinessTemplate \ AddWorkflowToBusinessTemplate \
AddWorkflowChainToBusinessTemplate \
AddCatalogMethodToBusinessTemplate \ AddCatalogMethodToBusinessTemplate \
AddKeysAndTableToBusinessTemplate \ AddKeysAndTableToBusinessTemplate \
AddRoleToBusinessTemplate \ AddRoleToBusinessTemplate \
...@@ -3034,19 +3068,23 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -3034,19 +3068,23 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CheckMissingDependencies \ CheckMissingDependencies \
UseDependencyBusinessTemplate \ UseDependencyBusinessTemplate \
BuildBusinessTemplate \ BuildBusinessTemplate \
InstallCurrentBusinessTemplate \ SaveBusinessTemplate \
RemovePortalType \
RemoveBusinessTemplate \
ImportBusinessTemplate \
UseImportBusinessTemplate \
InstallBusinessTemplate \
CheckInstalledInstallationState \ CheckInstalledInstallationState \
UseExportBusinessTemplate \ UseExportBusinessTemplate \
CheckNoMissingDependencies \ CheckNoMissingDependencies \
UseDependencyBusinessTemplate \ UseImportBusinessTemplate \
UninstallBusinessTemplate \ UninstallBusinessTemplate \
UseExportBusinessTemplate \ UseExportBusinessTemplate \
CheckMissingDependencies \ CheckMissingDependencies \
UseDependencyBusinessTemplate \ UseImportBusinessTemplate \
RemoveBusinessTemplate \ RemoveBusinessTemplate \
UseExportBusinessTemplate \ UseExportBusinessTemplate \
RemoveBusinessTemplate \ RemoveBusinessTemplate \
RemovePortalType \
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
...@@ -3114,10 +3152,14 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -3114,10 +3152,14 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
UseExportBusinessTemplate \ UseExportBusinessTemplate \
AddSkinFolderToBusinessTemplate \ AddSkinFolderToBusinessTemplate \
BuildBusinessTemplate \ BuildBusinessTemplate \
InstallCurrentBusinessTemplate \ SaveBusinessTemplate \
RemovePortalType \
RemoveBusinessTemplate \
ImportBusinessTemplate \
UseImportBusinessTemplate \
InstallBusinessTemplate \
UninstallBusinessTemplate \ UninstallBusinessTemplate \
RemoveBusinessTemplate \ RemoveBusinessTemplate \
RemovePortalType \
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
...@@ -3156,11 +3198,15 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -3156,11 +3198,15 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
UseExportBusinessTemplate \ UseExportBusinessTemplate \
AddSkinFolderToBusinessTemplate \ AddSkinFolderToBusinessTemplate \
BuildBusinessTemplate \ BuildBusinessTemplate \
InstallCurrentBusinessTemplate \ SaveBusinessTemplate \
RemoveBusinessTemplate \
RemovePortalType \
ImportBusinessTemplate \
UseImportBusinessTemplate \
InstallBusinessTemplate \
RemoveSkinFolder \ RemoveSkinFolder \
UninstallBusinessTemplate \ UninstallBusinessTemplate \
RemoveBusinessTemplate \ RemoveBusinessTemplate \
RemovePortalType \
' '
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