From ec8eb7d77c9b489304b510687ed2da262cbfbabc Mon Sep 17 00:00:00 2001 From: Leonardo Rochael Almeida <leonardo@nexedi.com> Date: Mon, 16 Nov 2009 17:44:41 +0000 Subject: [PATCH] no more get_transaction(). The transaction module should be used everywhere git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30681 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../TestTemplateItem/testERP5SocialContracts.py | 11 ++++++----- bt5/erp5_social_contracts/bt/revision | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bt5/erp5_social_contracts/TestTemplateItem/testERP5SocialContracts.py b/bt5/erp5_social_contracts/TestTemplateItem/testERP5SocialContracts.py index 01c94152f6..02c48a98dc 100644 --- a/bt5/erp5_social_contracts/TestTemplateItem/testERP5SocialContracts.py +++ b/bt5/erp5_social_contracts/TestTemplateItem/testERP5SocialContracts.py @@ -28,6 +28,7 @@ import unittest +import transaction from DateTime import DateTime from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase @@ -54,19 +55,19 @@ class TestERP5SocialContracts(ERP5TypeTestCase): title='Person3') def beforeTearDown(self): - get_transaction().abort() + transaction.begin() self.portal.person_module.manage_delObjects( list(self.portal.person_module.objectIds())) self.portal.social_contract_module.manage_delObjects( list(self.portal.social_contract_module.objectIds())) - get_transaction().commit() + transaction.commit() self.tic() def test_getChildCount(self): self.assertEquals(0, self.person_1.Person_getChildCount()) self.person_2.setNaturalParentValue(self.person_1) - get_transaction().commit() + transaction.commit() self.tic() self.assertEquals(1, self.person_1.Person_getChildCount()) @@ -82,7 +83,7 @@ class TestERP5SocialContracts(ERP5TypeTestCase): start_date='2001-01-01') contract_1.setDestinationValueList((self.person_1, self.person_2)) contract_1.validate() - get_transaction().commit() + transaction.commit() self.tic() self.assertEquals(1, self.person_1.Person_getPartnerCount()) @@ -93,7 +94,7 @@ class TestERP5SocialContracts(ERP5TypeTestCase): contract_2.setStopDate('3000-01-01') contract_2.validate() - get_transaction().commit() + transaction.commit() self.tic() self.assertEquals(2, self.person_1.Person_getPartnerCount()) diff --git a/bt5/erp5_social_contracts/bt/revision b/bt5/erp5_social_contracts/bt/revision index da2d3988d7..3f10ffe7a4 100644 --- a/bt5/erp5_social_contracts/bt/revision +++ b/bt5/erp5_social_contracts/bt/revision @@ -1 +1 @@ -14 \ No newline at end of file +15 \ No newline at end of file -- 2.30.9