Commit 81368b17 authored by Jérome Perrin's avatar Jérome Perrin

In teardown, first abort the transaction to abort whatever changes have been

made, then remove objects that might have been created if a transaction has
been commited explicitly, and commit + tic to make this removal permanent.
( ZopeTestCase will abort in tearDown )



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17042 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 86d3aa3d
...@@ -137,11 +137,13 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -137,11 +137,13 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self.getTypesTool().getTypeInfo('Person').filter_content_types = 0 self.getTypesTool().getTypeInfo('Person').filter_content_types = 0
def beforeTearDown(self): def beforeTearDown(self):
get_transaction().abort()
for module in [ self.getPersonModule(), for module in [ self.getPersonModule(),
self.getOrganisationModule(), self.getOrganisationModule(),
self.getCategoryTool().region ]: self.getCategoryTool().region ]:
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
get_transaction().commit() get_transaction().commit()
self.tic()
def loginWithNoRole(self, quiet=0, run=run_all_test): def loginWithNoRole(self, quiet=0, run=run_all_test):
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
......
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