Commit 02f615e2 authored by Aurel's avatar Aurel

check that uid of categories do not change after an upgrade

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9968 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 31fa6ce6
...@@ -82,7 +82,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -82,7 +82,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
self.login() self.login()
portal = self.getPortal() portal = self.getPortal()
catalog_tool = self.getCatalogTool() catalog_tool = self.getCatalogTool()
self._catch_log_errors() #self._catch_log_errors()
def beforeTearDown(self): def beforeTearDown(self):
"""Remove objects created tests.""" """Remove objects created tests."""
...@@ -602,7 +602,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -602,7 +602,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
pc = self.getCategoryTool() pc = self.getCategoryTool()
base_category = pc.newContent(portal_type = 'Base Category') base_category = pc.newContent(portal_type = 'Base Category')
self.failUnless(base_category is not None) self.failUnless(base_category is not None)
sequence.edit(bc_id=base_category.getId()) sequence.edit(bc_id=base_category.getId(),)
def stepAddBaseCategoryToBusinessTemplate(self, sequence=None, sequence_list=None, **kw): def stepAddBaseCategoryToBusinessTemplate(self, sequence=None, sequence_list=None, **kw):
""" """
...@@ -610,7 +610,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -610,7 +610,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
""" """
bc_id = sequence.get('bc_id') bc_id = sequence.get('bc_id')
bt = sequence.get('current_bt') bt = sequence.get('current_bt')
bt.edit(template_base_category_list=[bc_id]) bt.edit(template_base_category_list=[bc_id,])
def stepAddBaseCategoryAsPathToBusinessTemplate(self, sequence=None, sequence_list=None, **kw): def stepAddBaseCategoryAsPathToBusinessTemplate(self, sequence=None, sequence_list=None, **kw):
""" """
...@@ -649,6 +649,25 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -649,6 +649,25 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
base_category = pc._getOb(bc_id, None) base_category = pc._getOb(bc_id, None)
self.failUnless(base_category is None) self.failUnless(base_category is None)
def stepSaveBaseCategoryUid(self, sequence=None, sequence_list=None, **kw):
"""
Check uid has not changed after an upgrade
"""
bc_id = sequence.get('bc_id')
pc = self.getCategoryTool()
base_category = pc._getOb(bc_id, None)
sequence.edit(bc_uid = base_category.getUid())
def stepCheckBaseCategoryUid(self, sequence=None, sequence_list=None, **kw):
"""
Check uid has not changed after an upgrade
"""
bc_id = sequence.get('bc_id')
bc_uid = sequence.get('bc_uid')
pc = self.getCategoryTool()
base_category = pc._getOb(bc_id, None)
self.assertEqual(bc_uid, base_category.getUid())
# categories # categories
def stepCreateCategories(self, sequence=None, sequence_list=None, **kw): def stepCreateCategories(self, sequence=None, sequence_list=None, **kw):
""" """
...@@ -2066,6 +2085,8 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -2066,6 +2085,8 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
RemoveBaseCategory \ RemoveBaseCategory \
RemoveBusinessTemplate \ RemoveBusinessTemplate \
RemoveAllTrashBins \ RemoveAllTrashBins \
Tic \
CheckBaseCategoryRemoved \
ImportBusinessTemplate \ ImportBusinessTemplate \
UseImportBusinessTemplate \ UseImportBusinessTemplate \
CheckBuiltBuildingState \ CheckBuiltBuildingState \
...@@ -2077,6 +2098,19 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -2077,6 +2098,19 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CheckTrashBin \ CheckTrashBin \
CheckSkinsLayers \ CheckSkinsLayers \
CheckBaseCategoryExists \ CheckBaseCategoryExists \
SaveBaseCategoryUid \
RemoveAllTrashBins \
ImportBusinessTemplate \
UseImportBusinessTemplate \
CheckBuiltBuildingState \
CheckNotInstalledInstallationState \
InstallBusinessTemplate \
Tic \
CheckInstalledInstallationState \
CheckBuiltBuildingState \
CheckTrashBin \
CheckBaseCategoryExists \
CheckBaseCategoryUid \
UninstallBusinessTemplate \ UninstallBusinessTemplate \
CheckBuiltBuildingState \ CheckBuiltBuildingState \
CheckNotInstalledInstallationState \ CheckNotInstalledInstallationState \
......
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