Restore deleted portal_activities on beforeTearDown

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31308 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 342e4794
...@@ -74,8 +74,16 @@ class TestXMLMatrix(ERP5TypeTestCase, LogInterceptor): ...@@ -74,8 +74,16 @@ class TestXMLMatrix(ERP5TypeTestCase, LogInterceptor):
order = module.newContent(id='1', portal_type='Purchase Order') order = module.newContent(id='1', portal_type='Purchase Order')
self._catch_log_errors(ignored_level=PROBLEM) self._catch_log_errors(ignored_level=PROBLEM)
portal_activities_backup = None
def beforeTearDown(self): def beforeTearDown(self):
self._ignore_log_errors() self._ignore_log_errors()
if self.portal_activities_backup is not None:
self.portal._setObject('portal_activities',
self.portal_activities_backup)
get_transaction().commit()
del self.portal_activities_backup
return ERP5TypeTestCase.beforeTearDown(self)
def test_01_RenameCellRange(self, quiet=quiet): def test_01_RenameCellRange(self, quiet=quiet):
...@@ -198,8 +206,7 @@ class TestXMLMatrix(ERP5TypeTestCase, LogInterceptor): ...@@ -198,8 +206,7 @@ class TestXMLMatrix(ERP5TypeTestCase, LogInterceptor):
portal = self.getPortal() portal = self.getPortal()
module = portal.purchase_order_module module = portal.purchase_order_module
if not active: if not active:
# FIXME: deleting portal_activities prevent from running another test self.portal_activities_backup = portal._getOb('portal_activities')
# after this one (because this methods commits the transaction)
portal._delObject('portal_activities') portal._delObject('portal_activities')
module.recursiveImmediateReindexObject() module.recursiveImmediateReindexObject()
else: else:
......
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