Commit 72ec5cfd authored by Rafael Monnerat's avatar Rafael Monnerat

Re-catalog in case of mysql table is not present

This tests try to install a business template that modifies the catalog,
if it fails, it is required to launch recatalog to update MYSQL
 information, otherwise the further tests will fail due the lack of the
email table present.
parent 35d8bbce
...@@ -485,6 +485,7 @@ class TestTemplateTool(ERP5TypeTestCase): ...@@ -485,6 +485,7 @@ class TestTemplateTool(ERP5TypeTestCase):
def test_installBusinessTemplatesFromRepository_update_catalog(self): def test_installBusinessTemplatesFromRepository_update_catalog(self):
""" Test if update catalog is trigger when needed. """ Test if update catalog is trigger when needed.
""" """
try:
bt5_name = 'erp5_ingestion_mysql_innodb_catalog' bt5_name = 'erp5_ingestion_mysql_innodb_catalog'
template_tool = self.portal.portal_templates template_tool = self.portal.portal_templates
self.tic() self.tic()
...@@ -496,6 +497,7 @@ class TestTemplateTool(ERP5TypeTestCase): ...@@ -496,6 +497,7 @@ class TestTemplateTool(ERP5TypeTestCase):
self.assertTrue("Installed %s with" % bt5_name in operation_log[0]) self.assertTrue("Installed %s with" % bt5_name in operation_log[0])
bt = template_tool.getInstalledBusinessTemplate(bt5_name) bt = template_tool.getInstalledBusinessTemplate(bt5_name)
self.assertNotEquals(bt.getId(), None) self.assertNotEquals(bt.getId(), None)
self.commit()
self.checkFolderReindexAllActivityNotPresent() self.checkFolderReindexAllActivityNotPresent()
self.tic() self.tic()
...@@ -531,6 +533,14 @@ class TestTemplateTool(ERP5TypeTestCase): ...@@ -531,6 +533,14 @@ class TestTemplateTool(ERP5TypeTestCase):
self.commit() self.commit()
self.checkFolderReindexAllActivityNotPresent() self.checkFolderReindexAllActivityNotPresent()
self.tic() self.tic()
finally:
# Make sure no broken catalog it will be left behind and propaguated to
# the next tests.
if len(self.portal.portal_activities.getMessageList())>0:
self.portal.portal_activities.manageClearActivities()
self.commit()
self.portal.ERP5Site_reindexAll(clear_catalog=1)
self.tic()
def test_installBusinessTemplatesFromRepository_activate(self): def test_installBusinessTemplatesFromRepository_activate(self):
""" Test if update catalog is trigger when needed. """ Test if update catalog is trigger when needed.
......
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