[Erp5-report] r30026 - /erp5/trunk/products/ERP5/tests/testAccounting.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Oct 27 12:38:21 CET 2009
Author: jerome
Date: Tue Oct 27 12:38:18 2009
New Revision: 30026
URL: http://svn.erp5.org?rev=30026&view=rev
Log:
cleanup organisations and accounts between tests
Modified:
erp5/trunk/products/ERP5/tests/testAccounting.py
Modified: erp5/trunk/products/ERP5/tests/testAccounting.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testAccounting.py?rev=30026&r1=30025&r2=30026&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py [utf8] Tue Oct 27 12:38:18 2009
@@ -2833,11 +2833,23 @@
def beforeTearDown(self):
"""Cleanup for next test.
- All tests uses the same accounts and same entities, so we just cleanup
- accounting module and simulation. """
+ """
transaction.abort()
for folder in (self.accounting_module, self.portal.portal_simulation):
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()
self.tic()
More information about the Erp5-report
mailing list