Commit 997b8190 authored by Jérome Perrin's avatar Jérome Perrin

cleanup organisations and accounts between tests


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30026 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 557feee2
...@@ -2833,11 +2833,23 @@ class TestAccountingWithSequences(AccountingTestCase): ...@@ -2833,11 +2833,23 @@ class TestAccountingWithSequences(AccountingTestCase):
def beforeTearDown(self): def beforeTearDown(self):
"""Cleanup for next test. """Cleanup for next test.
All tests uses the same accounts and same entities, so we just cleanup """
accounting module and simulation. """
transaction.abort() transaction.abort()
for folder in (self.accounting_module, self.portal.portal_simulation): for folder in (self.accounting_module, self.portal.portal_simulation):
folder.manage_delObjects([i for i in folder.objectIds()]) folder.manage_delObjects([i for i in folder.objectIds()])
# Some tests commits transaction, some other does not, so accounts and
# organisations created in this tests will not always be present at this
# point
folder = self.portal.account_module
for account in self.account_list:
if account.getId() in folder.objectIds():
folder.manage_delObjects([account.getId()])
folder = self.portal.organisation_module
for entity in (self.client, self.vendor, self.other_vendor):
if entity.getId() in folder.objectIds():
folder.manage_delObjects([entity.getId()])
transaction.commit() transaction.commit()
self.tic() self.tic()
......
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