Commit 1aacac22 authored by Aurel's avatar Aurel

test update of workflow and tool with more objects


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4964 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c0ac0986
...@@ -120,10 +120,8 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -120,10 +120,8 @@ class TestBusinessTemplate(ERP5TypeTestCase):
# make copy # make copy
copy_data = template_tool.manage_copyObjects(ids=[core_bt.getId()]) copy_data = template_tool.manage_copyObjects(ids=[core_bt.getId()])
ids = template_tool.manage_pasteObjects(copy_data) ids = template_tool.manage_pasteObjects(copy_data)
LOG('id after copy', 0, ids)
new_id = ids[0]['new_id'] new_id = ids[0]['new_id']
new_bt = template_tool._getOb(new_id) new_bt = template_tool._getOb(new_id)
LOG(new_bt, 0, str((new_bt.getTitle(), new_id)))
self.assertEqual(new_bt.getTitle(), 'erp5_core') self.assertEqual(new_bt.getTitle(), 'erp5_core')
sequence.edit(copy_bt=new_bt) sequence.edit(copy_bt=new_bt)
...@@ -327,7 +325,6 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -327,7 +325,6 @@ class TestBusinessTemplate(ERP5TypeTestCase):
bt = sequence.get('current_bt', None) bt = sequence.get('current_bt', None)
self.failUnless(bt is not None) self.failUnless(bt is not None)
bt.getPortalTypesProperties() bt.getPortalTypesProperties()
LOG("portal types properties added for", 0, bt.getTitle())
# module # module
def stepCreateModuleAndObjects(self, sequence=None, sequence_list=None, **kw): def stepCreateModuleAndObjects(self, sequence=None, sequence_list=None, **kw):
...@@ -540,7 +537,6 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -540,7 +537,6 @@ class TestBusinessTemplate(ERP5TypeTestCase):
pc = self.getCategoryTool() pc = self.getCategoryTool()
bc_id = sequence.get('bc_id') bc_id = sequence.get('bc_id')
base_category = pc._getOb(bc_id, None) base_category = pc._getOb(bc_id, None)
LOG('base category is', 0, base_category)
self.failUnless(base_category is None) self.failUnless(base_category is None)
# categories # categories
...@@ -863,7 +859,7 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -863,7 +859,7 @@ class TestBusinessTemplate(ERP5TypeTestCase):
catalog = pc._getOb('erp5_mysql', None) catalog = pc._getOb('erp5_mysql', None)
self.failUnless(catalog is not None) self.failUnless(catalog is not None)
method_id = sequence.get('zsql_method_id', None) method_id = sequence.get('zsql_method_id', None)
zsql_method = catalog._getOb(method_id, None) zsql_method = catalog._getOb(method_id, None)
self.failUnless(zsql_method is not None) self.failUnless(zsql_method is not None)
# check catalog properties # check catalog properties
self.failUnless(method_id in catalog.sql_uncatalog_object) self.failUnless(method_id in catalog.sql_uncatalog_object)
...@@ -926,7 +922,6 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -926,7 +922,6 @@ class TestBusinessTemplate(ERP5TypeTestCase):
topic_key = 'fake_topic' topic_key = 'fake_topic'
catalog = self.getCatalogTool().getSQLCatalog() catalog = self.getCatalogTool().getSQLCatalog()
self.failUnless(catalog is not None) self.failUnless(catalog is not None)
LOG("catalog is", 0, catalog.getId())
# result key # result key
sql_search_result_keys = list(catalog.sql_search_result_keys) sql_search_result_keys = list(catalog.sql_search_result_keys)
sql_search_result_keys.append(result_key) sql_search_result_keys.append(result_key)
...@@ -1412,9 +1407,21 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -1412,9 +1407,21 @@ class TestBusinessTemplate(ERP5TypeTestCase):
prop_dict[pid] = 0 prop_dict[pid] = 0
elif prop_type == 'lines' or prop_type == 'tokens': elif prop_type == 'lines' or prop_type == 'tokens':
prop_dict[pid[:-5]] = () prop_dict[pid[:-5]] = ()
LOG('prop dict', 0, prop_dict)
bt.edit(**prop_dict) bt.edit(**prop_dict)
def stepRemoveTrashTool(self, sequence=None, sequence_list=None, **kw):
"""
Remove Trash Tool from site
"""
p = self.getPortal()
p.manage_delObjects(['portal_trash'])
self.failUnless(p._getOb('portal_trash', None) is None)
def stepCheckTrashToolExists(self, sequence=None, sequence_list=None, **kw):
"""
Check presence of trash tool
"""
self.failUnless(self.getTrashTool() is not None)
# tests # tests
def test_01_checkNewSite(self, quiet=0, run=run_all_test): def test_01_checkNewSite(self, quiet=0, run=run_all_test):
...@@ -2303,11 +2310,21 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -2303,11 +2310,21 @@ class TestBusinessTemplate(ERP5TypeTestCase):
CheckRoleExists \ CheckRoleExists \
CheckPropertySheetExists \ CheckPropertySheetExists \
CheckSkinsLayers \ CheckSkinsLayers \
RemovePortalType \
RemoveModule \
RemoveSkinFolder \
RemoveBaseCategory \
RemoveWorkflow \
RemoveCatalogMethod \
RemoveKeysAndTable \
RemoveRole \
RemovePropertySheet \
RemoveBusinessTemplate \
RemoveAllTrashBins \
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
# test specific to erp5_core # test specific to erp5_core
def test_18_checkUpdateBusinessTemplateWorkflow(self, quiet=0, run=run_all_test): def test_18_checkUpdateBusinessTemplateWorkflow(self, quiet=0, run=run_all_test):
if not run: return if not run: return
...@@ -2317,10 +2334,34 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -2317,10 +2334,34 @@ class TestBusinessTemplate(ERP5TypeTestCase):
LOG('Testing... ', 0, message) LOG('Testing... ', 0, message)
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = '\ sequence_string = '\
CreatePortalType \
CreateModuleAndObjects \
CreateSkinFolder \
CreateBaseCategory \
CreateCategories \
CreateSubCategories \
CreateWorkflow \
CreateAction \
CreateOptionalAction \
CreateCatalogMethod \
CreateKeysAndTable \
CreateRole \
CreatePropertySheet \
CopyCoreBusinessTemplate \ CopyCoreBusinessTemplate \
UseCopyCoreBusinessTemplate \ UseCopyCoreBusinessTemplate \
ClearBusinessTemplateField \ ClearBusinessTemplateField \
SetUpdateWorkflowFlagInBusinessTemplate \ SetUpdateWorkflowFlagInBusinessTemplate \
AddPortalTypeToBusinessTemplate \
AddModuleToBusinessTemplate \
AddSkinFolderToBusinessTemplate \
AddBaseCategoryToBusinessTemplate \
AddSubCategoriesAsPathToBusinessTemplate \
AddWorkflowToBusinessTemplate \
AddOptionalActionToBusinessTemplate \
AddCatalogMethodToBusinessTemplate \
AddKeysAndTableToBusinessTemplate \
AddRoleToBusinessTemplate \
AddPropertySheetToBusinessTemplate \
CheckModifiedBuildingState \ CheckModifiedBuildingState \
CheckNotInstalledInstallationState \ CheckNotInstalledInstallationState \
BuildBusinessTemplate \ BuildBusinessTemplate \
...@@ -2341,6 +2382,28 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -2341,6 +2382,28 @@ class TestBusinessTemplate(ERP5TypeTestCase):
CheckBuiltBuildingState \ CheckBuiltBuildingState \
CheckTrashBin \ CheckTrashBin \
CheckSkinsLayers \ CheckSkinsLayers \
CheckPortalTypeExists \
CheckModuleExists \
CheckSkinFolderExists \
CheckBaseCategoryExists \
CheckCategoriesExists \
CheckSubCategoriesExists \
CheckWorkflowExists \
CheckOptionalActionExists \
CheckCatalogMethodExists \
CheckKeysAndTableExists \
CheckRoleExists \
CheckPropertySheetExists \
RemovePortalType \
RemoveModule \
RemoveSkinFolder \
RemoveBaseCategory \
RemoveWorkflow \
RemoveCatalogMethod \
RemoveKeysAndTable \
RemoveRole \
RemovePropertySheet \
RemoveBusinessTemplate \
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
...@@ -2354,10 +2417,34 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -2354,10 +2417,34 @@ class TestBusinessTemplate(ERP5TypeTestCase):
LOG('Testing... ', 0, message) LOG('Testing... ', 0, message)
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = '\ sequence_string = '\
CreatePortalType \
CreateModuleAndObjects \
CreateSkinFolder \
CreateBaseCategory \
CreateCategories \
CreateSubCategories \
CreateWorkflow \
CreateAction \
CreateOptionalAction \
CreateCatalogMethod \
CreateKeysAndTable \
CreateRole \
CreatePropertySheet \
CopyCoreBusinessTemplate \ CopyCoreBusinessTemplate \
UseCopyCoreBusinessTemplate \ UseCopyCoreBusinessTemplate \
ClearBusinessTemplateField \ ClearBusinessTemplateField \
SetUpdateToolFlagInBusinessTemplate \ SetUpdateToolFlagInBusinessTemplate \
AddPortalTypeToBusinessTemplate \
AddModuleToBusinessTemplate \
AddSkinFolderToBusinessTemplate \
AddBaseCategoryToBusinessTemplate \
AddSubCategoriesAsPathToBusinessTemplate \
AddWorkflowToBusinessTemplate \
AddOptionalActionToBusinessTemplate \
AddCatalogMethodToBusinessTemplate \
AddKeysAndTableToBusinessTemplate \
AddRoleToBusinessTemplate \
AddPropertySheetToBusinessTemplate \
CheckModifiedBuildingState \ CheckModifiedBuildingState \
CheckNotInstalledInstallationState \ CheckNotInstalledInstallationState \
BuildBusinessTemplate \ BuildBusinessTemplate \
...@@ -2367,7 +2454,18 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -2367,7 +2454,18 @@ class TestBusinessTemplate(ERP5TypeTestCase):
SaveBusinessTemplate \ SaveBusinessTemplate \
CheckBuiltBuildingState \ CheckBuiltBuildingState \
CheckNotInstalledInstallationState \ CheckNotInstalledInstallationState \
RemovePortalType \
RemoveModule \
RemoveSkinFolder \
RemoveBaseCategory \
RemoveWorkflow \
RemoveCatalogMethod \
RemoveKeysAndTable \
RemoveRole \
RemovePropertySheet \
RemoveBusinessTemplate \
RemoveAllTrashBins \ RemoveAllTrashBins \
RemoveTrashTool \
ImportBusinessTemplate \ ImportBusinessTemplate \
UseImportBusinessTemplate \ UseImportBusinessTemplate \
CheckBuiltBuildingState \ CheckBuiltBuildingState \
...@@ -2376,8 +2474,30 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -2376,8 +2474,30 @@ class TestBusinessTemplate(ERP5TypeTestCase):
Tic \ Tic \
CheckInstalledInstallationState \ CheckInstalledInstallationState \
CheckBuiltBuildingState \ CheckBuiltBuildingState \
CheckTrashBin \ CheckTrashToolExists \
CheckSkinsLayers \ CheckSkinsLayers \
CheckPortalTypeExists \
CheckModuleExists \
CheckSkinFolderExists \
CheckBaseCategoryExists \
CheckCategoriesExists \
CheckSubCategoriesExists \
CheckWorkflowExists \
CheckOptionalActionExists \
CheckCatalogMethodExists \
CheckKeysAndTableExists \
CheckRoleExists \
CheckPropertySheetExists \
RemovePortalType \
RemoveModule \
RemoveSkinFolder \
RemoveBaseCategory \
RemoveWorkflow \
RemoveCatalogMethod \
RemoveKeysAndTable \
RemoveRole \
RemovePropertySheet \
RemoveBusinessTemplate \
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
......
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