Commit 8995b645 authored by Julien Muchembled's avatar Julien Muchembled

tests: always start transactions with begin() and make tic() commit automatically

parent ee196dff
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
import os import os
import transaction
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure from Products.ERP5Type.tests.backportUnittest import expectedFailure
...@@ -795,7 +794,6 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -795,7 +794,6 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
delivery.confirm() delivery.confirm()
delivery.start() delivery.start()
delivery.stop() delivery.stop()
transaction.commit()
self.tic() self.tic()
# inventories of that resource are index in grams # inventories of that resource are index in grams
......
637 638
\ No newline at end of file \ No newline at end of file
...@@ -34,7 +34,6 @@ from AccessControl import Unauthorized ...@@ -34,7 +34,6 @@ from AccessControl import Unauthorized
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.Sequence import Step, Sequence, SequenceList from Products.ERP5Type.tests.Sequence import Step, Sequence, SequenceList
from zLOG import LOG from zLOG import LOG
import transaction
import random import random
import email import email
from email.header import decode_header, make_header from email.header import decode_header, make_header
...@@ -80,7 +79,7 @@ class TestEGovMixin(SecurityTestCase): ...@@ -80,7 +79,7 @@ class TestEGovMixin(SecurityTestCase):
for idx, step in enumerate(self._step_list): for idx, step in enumerate(self._step_list):
step.play(context, sequence=self, quiet=quiet) step.play(context, sequence=self, quiet=quiet)
# commit transaction after each step # commit transaction after each step
transaction.commit() self.commit()
Sequence.play = play Sequence.play = play
def play(self, context, sequence=None, quiet=0): def play(self, context, sequence=None, quiet=0):
...@@ -139,7 +138,6 @@ class TestEGovMixin(SecurityTestCase): ...@@ -139,7 +138,6 @@ class TestEGovMixin(SecurityTestCase):
self.portal.__class__.DeclarationTVA_zGetSIGTASInformation \ self.portal.__class__.DeclarationTVA_zGetSIGTASInformation \
= lambda x,**kw: [] = lambda x,**kw: []
transaction.commit()
self.tic() self.tic()
def beforeTearDown(self): def beforeTearDown(self):
...@@ -148,7 +146,6 @@ class TestEGovMixin(SecurityTestCase): ...@@ -148,7 +146,6 @@ class TestEGovMixin(SecurityTestCase):
# we want to keep some IDs # we want to keep some IDs
module.manage_delObjects([x for x in module.objectIds() module.manage_delObjects([x for x in module.objectIds()
if x not in ('EUR',)]) if x not in ('EUR',)])
transaction.commit()
self.tic() self.tic()
def getUserFolder(self) : def getUserFolder(self) :
...@@ -200,7 +197,6 @@ class TestEGovMixin(SecurityTestCase): ...@@ -200,7 +197,6 @@ class TestEGovMixin(SecurityTestCase):
'group/dgid/di/csf/bf') 'group/dgid/di/csf/bf')
# make this available to catalog # make this available to catalog
transaction.commit()
self.tic() self.tic()
def createOneOrganisation(self, username, role=None, function=None, def createOneOrganisation(self, username, role=None, function=None,
...@@ -232,7 +228,6 @@ class TestEGovMixin(SecurityTestCase): ...@@ -232,7 +228,6 @@ class TestEGovMixin(SecurityTestCase):
role='entreprise/siege') role='entreprise/siege')
# make this available to catalog # make this available to catalog
transaction.commit()
self.tic() self.tic()
def checkRights(self, object_list, security_mapping, username): def checkRights(self, object_list, security_mapping, username):
......
758 759
\ No newline at end of file \ No newline at end of file
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
import transaction
from httplib import OK as HTTP_OK from httplib import OK as HTTP_OK
class TestDiscussionThread(SecurityTestCase): class TestDiscussionThread(SecurityTestCase):
...@@ -109,7 +108,6 @@ class TestDiscussionThread(SecurityTestCase): ...@@ -109,7 +108,6 @@ class TestDiscussionThread(SecurityTestCase):
self.assertUserCanViewDocument('forum_user', post) self.assertUserCanViewDocument('forum_user', post)
self.assertUserCanAccessDocument('forum_user', post) self.assertUserCanAccessDocument('forum_user', post)
transaction.commit()
self.tic() self.tic()
thread_posts = thread.objectValues() thread_posts = thread.objectValues()
...@@ -180,7 +178,7 @@ class TestDiscussionThread(SecurityTestCase): ...@@ -180,7 +178,7 @@ class TestDiscussionThread(SecurityTestCase):
self.assertUserCanPassWorkflowTransition('admin', 'close_action', thread) self.assertUserCanPassWorkflowTransition('admin', 'close_action', thread)
thread.close() thread.close()
transaction.commit() self.commit()
self.assertUserCanViewDocument('admin', thread) self.assertUserCanViewDocument('admin', thread)
self.assertUserCanAccessDocument('admin', thread) self.assertUserCanAccessDocument('admin', thread)
......
3 4
\ No newline at end of file \ No newline at end of file
...@@ -34,7 +34,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import _getConversionServerDict ...@@ -34,7 +34,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import _getConversionServerDict
from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeLiveTestCase from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeLiveTestCase
from zLOG import LOG, INFO, ERROR from zLOG import LOG, INFO, ERROR
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
import transaction
import random import random
import string import string
...@@ -85,7 +84,6 @@ class TestIngestion(ERP5TypeLiveTestCase): ...@@ -85,7 +84,6 @@ class TestIngestion(ERP5TypeLiveTestCase):
document_parent = document.getParentValue() document_parent = document.getParentValue()
document_parent._delObject(doucument_id) document_parent._delObject(doucument_id)
# Unindex deleted documents # Unindex deleted documents
transaction.commit()
self.tic() self.tic()
def setSystemPreference(self): def setSystemPreference(self):
...@@ -121,7 +119,6 @@ class TestIngestion(ERP5TypeLiveTestCase): ...@@ -121,7 +119,6 @@ class TestIngestion(ERP5TypeLiveTestCase):
script_id = 'ERP5Site_getTextFileWithFileName' script_id = 'ERP5Site_getTextFileWithFileName'
filename = 'any_file.txt' filename = 'any_file.txt'
document = self.contributeFileWithUrl(script_id, filename=filename) document = self.contributeFileWithUrl(script_id, filename=filename)
transaction.commit()
self.tic() self.tic()
self.assertEquals(document.getPortalType(), 'Text') self.assertEquals(document.getPortalType(), 'Text')
self.assertEquals(document.getFilename(), filename) self.assertEquals(document.getFilename(), filename)
...@@ -135,7 +132,6 @@ class TestIngestion(ERP5TypeLiveTestCase): ...@@ -135,7 +132,6 @@ class TestIngestion(ERP5TypeLiveTestCase):
""" """
script_id = 'ERP5Site_getTextFile.txt' script_id = 'ERP5Site_getTextFile.txt'
document = self.contributeFileWithUrl(script_id) document = self.contributeFileWithUrl(script_id)
transaction.commit()
self.tic() self.tic()
self.assertEquals(document.getPortalType(), 'Text') self.assertEquals(document.getPortalType(), 'Text')
self.assertEquals(document.getFilename(), script_id) self.assertEquals(document.getFilename(), script_id)
...@@ -148,7 +144,6 @@ class TestIngestion(ERP5TypeLiveTestCase): ...@@ -148,7 +144,6 @@ class TestIngestion(ERP5TypeLiveTestCase):
""" """
script_id = 'ERP5Site_getTextFileWithoutContentType.txt' script_id = 'ERP5Site_getTextFileWithoutContentType.txt'
document = self.contributeFileWithUrl(script_id) document = self.contributeFileWithUrl(script_id)
transaction.commit()
self.tic() self.tic()
self.assertEquals(document.getPortalType(), 'Text') self.assertEquals(document.getPortalType(), 'Text')
self.assertEquals(document.getFilename(), script_id) self.assertEquals(document.getFilename(), script_id)
...@@ -162,7 +157,6 @@ class TestIngestion(ERP5TypeLiveTestCase): ...@@ -162,7 +157,6 @@ class TestIngestion(ERP5TypeLiveTestCase):
script_id = 'ERP5Site_getTextFileWithFileNameAndRedirection' script_id = 'ERP5Site_getTextFileWithFileNameAndRedirection'
filename = 'any_file.txt' filename = 'any_file.txt'
document = self.contributeFileWithUrl(script_id, filename=filename) document = self.contributeFileWithUrl(script_id, filename=filename)
transaction.commit()
self.tic() self.tic()
self.assertEquals(document.getPortalType(), 'Text') self.assertEquals(document.getPortalType(), 'Text')
self.assertEquals(document.getFilename(), filename) self.assertEquals(document.getFilename(), filename)
...@@ -176,7 +170,6 @@ class TestIngestion(ERP5TypeLiveTestCase): ...@@ -176,7 +170,6 @@ class TestIngestion(ERP5TypeLiveTestCase):
""" """
script_id = 'ERP5Site_getTextFileWithoutFileNameButHTMLContentType' script_id = 'ERP5Site_getTextFileWithoutFileNameButHTMLContentType'
document = self.contributeFileWithUrl(script_id) document = self.contributeFileWithUrl(script_id)
transaction.commit()
self.tic() self.tic()
self.assertEquals(document.getPortalType(), 'Web Page') self.assertEquals(document.getPortalType(), 'Web Page')
self.assertEquals(document.getFilename(), script_id) self.assertEquals(document.getFilename(), script_id)
......
140 141
\ No newline at end of file \ No newline at end of file
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
############################################################################## ##############################################################################
import os, shutil, tempfile, unittest import os, shutil, tempfile, unittest
import transaction
from Acquisition import aq_base from Acquisition import aq_base
from Products.ERP5Type.Base import Base from Products.ERP5Type.Base import Base
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
...@@ -45,7 +44,7 @@ class TestInotifyTool(ERP5TypeTestCase): ...@@ -45,7 +44,7 @@ class TestInotifyTool(ERP5TypeTestCase):
for inotify in inotify_tool.objectValues(): for inotify in inotify_tool.objectValues():
inotify._setEnabled(False) inotify._setEnabled(False)
inotify_tool._p_changed = 1 inotify_tool._p_changed = 1
transaction.commit() self.commit()
def checkCache(notify_list): def checkCache(notify_list):
self.assertEqual(notify_list, self.assertEqual(notify_list,
getattr(aq_base(inotify_tool), '_v_notify_list', None)) getattr(aq_base(inotify_tool), '_v_notify_list', None))
...@@ -53,7 +52,7 @@ class TestInotifyTool(ERP5TypeTestCase): ...@@ -53,7 +52,7 @@ class TestInotifyTool(ERP5TypeTestCase):
tmp_dir = tempfile.mkdtemp() tmp_dir = tempfile.mkdtemp()
try: try:
inotify_tool.process_timer(None, None) inotify_tool.process_timer(None, None)
transaction.commit() self.commit()
checkCache([]) checkCache([])
inotify = inotify_tool.newContent(inode_path='string:'+tmp_dir, inotify = inotify_tool.newContent(inode_path='string:'+tmp_dir,
sense_method_id='Inotify_test', sense_method_id='Inotify_test',
...@@ -61,34 +60,34 @@ class TestInotifyTool(ERP5TypeTestCase): ...@@ -61,34 +60,34 @@ class TestInotifyTool(ERP5TypeTestCase):
inotify_id = inotify.getId() inotify_id = inotify.getId()
checkCache(None) checkCache(None)
inotify_tool.process_timer(None, None) inotify_tool.process_timer(None, None)
transaction.commit() self.commit()
checkCache([]) checkCache([])
event_list = [] event_list = []
inotify.__class__.Inotify_test = lambda self, events: \ inotify.__class__.Inotify_test = lambda self, events: \
event_list.extend(events) event_list.extend(events)
try: try:
inotify.setEnabled(True) inotify.setEnabled(True)
transaction.commit() self.commit()
checkCache(None) checkCache(None)
inotify_tool.process_timer(None, None) inotify_tool.process_timer(None, None)
transaction.commit() self.commit()
checkCache([inotify_id]) checkCache([inotify_id])
self.assertEqual(event_list, []) self.assertEqual(event_list, [])
p = os.path.join(tmp_dir, '1') p = os.path.join(tmp_dir, '1')
with open(p, 'w') as f: with open(p, 'w') as f:
inotify_tool.process_timer(None, None) inotify_tool.process_timer(None, None)
transaction.commit() self.commit()
self.assertEqual(event_list, [{'path': p, 'mask': IN_CREATE}]) self.assertEqual(event_list, [{'path': p, 'mask': IN_CREATE}])
del event_list[:] del event_list[:]
f.write('foo') f.write('foo')
inotify_tool.process_timer(None, None) inotify_tool.process_timer(None, None)
transaction.commit() self.commit()
self.assertEqual(event_list, [{'path': p, 'mask': IN_MODIFY}]) self.assertEqual(event_list, [{'path': p, 'mask': IN_MODIFY}])
del event_list[:] del event_list[:]
p2 = os.path.join(tmp_dir, '2') p2 = os.path.join(tmp_dir, '2')
os.rename(p, p2) os.rename(p, p2)
inotify_tool.process_timer(None, None) inotify_tool.process_timer(None, None)
transaction.commit() self.commit()
expected = [{'path': p, 'mask': IN_DELETE}, expected = [{'path': p, 'mask': IN_DELETE},
{'path': p2, 'mask': IN_CREATE}] {'path': p2, 'mask': IN_CREATE}]
expected.remove(event_list.pop()) expected.remove(event_list.pop())
......
3 4
\ No newline at end of file \ No newline at end of file
...@@ -27,10 +27,7 @@ ...@@ -27,10 +27,7 @@
############################################################################## ##############################################################################
import unittest import unittest
import transaction
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
...@@ -55,19 +52,17 @@ class TestERP5SocialContracts(ERP5TypeTestCase): ...@@ -55,19 +52,17 @@ class TestERP5SocialContracts(ERP5TypeTestCase):
title='Person3') title='Person3')
def beforeTearDown(self): def beforeTearDown(self):
transaction.begin() self.abort()
self.portal.person_module.manage_delObjects( self.portal.person_module.manage_delObjects(
list(self.portal.person_module.objectIds())) list(self.portal.person_module.objectIds()))
self.portal.social_contract_module.manage_delObjects( self.portal.social_contract_module.manage_delObjects(
list(self.portal.social_contract_module.objectIds())) list(self.portal.social_contract_module.objectIds()))
transaction.commit()
self.tic() self.tic()
def test_getChildCount(self): def test_getChildCount(self):
self.assertEquals(0, self.person_1.Person_getChildCount()) self.assertEquals(0, self.person_1.Person_getChildCount())
self.person_2.setNaturalParentValue(self.person_1) self.person_2.setNaturalParentValue(self.person_1)
transaction.commit()
self.tic() self.tic()
self.assertEquals(1, self.person_1.Person_getChildCount()) self.assertEquals(1, self.person_1.Person_getChildCount())
...@@ -83,7 +78,6 @@ class TestERP5SocialContracts(ERP5TypeTestCase): ...@@ -83,7 +78,6 @@ class TestERP5SocialContracts(ERP5TypeTestCase):
start_date='2001-01-01') start_date='2001-01-01')
contract_1.setDestinationValueList((self.person_1, self.person_2)) contract_1.setDestinationValueList((self.person_1, self.person_2))
contract_1.validate() contract_1.validate()
transaction.commit()
self.tic() self.tic()
self.assertEquals(1, self.person_1.Person_getPartnerCount()) self.assertEquals(1, self.person_1.Person_getPartnerCount())
...@@ -94,7 +88,6 @@ class TestERP5SocialContracts(ERP5TypeTestCase): ...@@ -94,7 +88,6 @@ class TestERP5SocialContracts(ERP5TypeTestCase):
contract_2.setStopDate('3000-01-01') contract_2.setStopDate('3000-01-01')
contract_2.validate() contract_2.validate()
transaction.commit()
self.tic() self.tic()
self.assertEquals(2, self.person_1.Person_getPartnerCount()) self.assertEquals(2, self.person_1.Person_getPartnerCount())
......
24 25
\ No newline at end of file \ No newline at end of file
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
############################################################################## ##############################################################################
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
import transaction
import unittest import unittest
from zLOG import LOG from zLOG import LOG
from Testing import ZopeTestCase from Testing import ZopeTestCase
...@@ -107,7 +106,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -107,7 +106,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
if sync.getValidationState() != "validated": if sync.getValidationState() != "validated":
sync.validate() sync.validate()
transaction.commit()
self.tic() self.tic()
def beforeTearDown(self): def beforeTearDown(self):
...@@ -117,7 +115,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -117,7 +115,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
for connector in self.oxatis.contentValues(portal_type="Web Service Connector"): for connector in self.oxatis.contentValues(portal_type="Web Service Connector"):
# use the test connector # use the test connector
connector.setTransport("oxatis") connector.setTransport("oxatis")
transaction.commit()
self.tic() self.tic()
...@@ -127,12 +124,10 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -127,12 +124,10 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
for im in ['organisation_module', 'delivered_organisation_module', for im in ['organisation_module', 'delivered_organisation_module',
'person_module', 'delivered_person_module',]: 'person_module', 'delivered_person_module',]:
LOG("RUNNING SYNCHRO FOR %s" %(im), 300, "") LOG("RUNNING SYNCHRO FOR %s" %(im), 300, "")
transaction.commit()
self.tic() self.tic()
self.oxatis.IntegrationSite_synchronize(reset=reset, synchronization_list=[im,], self.oxatis.IntegrationSite_synchronize(reset=reset, synchronization_list=[im,],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
if conflict_dict and conflict_dict.has_key(im): if conflict_dict and conflict_dict.has_key(im):
nb_pub_conflict, nb_sub_conflict, in_conflict = conflict_dict[im] nb_pub_conflict, nb_sub_conflict, in_conflict = conflict_dict[im]
...@@ -165,12 +160,10 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -165,12 +160,10 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
def _runAndCheckResourceSynchronization(self, reset=True): def _runAndCheckResourceSynchronization(self, reset=True):
# run synchronization # run synchronization
transaction.commit()
self.tic() self.tic()
self.oxatis.IntegrationSite_synchronize(reset=reset, synchronization_list=['product_module',], self.oxatis.IntegrationSite_synchronize(reset=reset, synchronization_list=['product_module',],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
# Check fix point # Check fix point
for im in ['product_module']: for im in ['product_module']:
...@@ -219,7 +212,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -219,7 +212,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
else: else:
if person.getValidationState() == "validated": if person.getValidationState() == "validated":
person.invalidate() person.invalidate()
transaction.commit()
self.tic() self.tic()
# Check initial data # Check initial data
self.assertEqual(len(self.portal.oxatis_test_module.contentValues(portal_type="Oxatis Test Person")), 6) self.assertEqual(len(self.portal.oxatis_test_module.contentValues(portal_type="Oxatis Test Person")), 6)
...@@ -454,7 +446,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -454,7 +446,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
# Delete products # Delete products
prod_ids = [x for x in self.portal.product_module.objectIds() if x != self.default_resource_id] prod_ids = [x for x in self.portal.product_module.objectIds() if x != self.default_resource_id]
self.portal.product_module.manage_delObjects(prod_ids) self.portal.product_module.manage_delObjects(prod_ids)
transaction.commit()
self.tic() self.tic()
# Check initial data # Check initial data
for product in self.portal.oxatis_test_module.contentValues(portal_type="Oxatis Test Product"): for product in self.portal.oxatis_test_module.contentValues(portal_type="Oxatis Test Product"):
...@@ -464,7 +455,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -464,7 +455,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
else: else:
if product.getValidationState() == "validated": if product.getValidationState() == "validated":
product.invalidate() product.invalidate()
transaction.commit()
self.tic() self.tic()
self.assertEqual(len(self.portal.oxatis_test_module.searchFolder(portal_type="Oxatis Test Product", self.assertEqual(len(self.portal.oxatis_test_module.searchFolder(portal_type="Oxatis Test Product",
...@@ -502,7 +492,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -502,7 +492,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
for product in self.portal.oxatis_test_module.contentValues(portal_type="Oxatis Test Product"): for product in self.portal.oxatis_test_module.contentValues(portal_type="Oxatis Test Product"):
if product.getValidationState() != "validated": if product.getValidationState() != "validated":
product.validate() product.validate()
transaction.commit()
self.tic() self.tic()
self.assertEqual(len(self.portal.oxatis_test_module.searchFolder(portal_type="Oxatis Test Product", self.assertEqual(len(self.portal.oxatis_test_module.searchFolder(portal_type="Oxatis Test Product",
...@@ -545,7 +534,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -545,7 +534,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
self.portal.sale_order_module.manage_delObjects(so_ids) self.portal.sale_order_module.manage_delObjects(so_ids)
# Define date on integration site # Define date on integration site
self.oxatis.edit(stop_date="2010/12/01") self.oxatis.edit(stop_date="2010/12/01")
transaction.commit()
self.tic() self.tic()
# Check initial data # Check initial data
self.assertEqual(len(self.portal.oxatis_test_module.contentValues(portal_type="Oxatis Test Sale Order")), 2) self.assertEqual(len(self.portal.oxatis_test_module.contentValues(portal_type="Oxatis Test Sale Order")), 2)
...@@ -558,7 +546,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -558,7 +546,6 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
# run synchronization # run synchronization
self.oxatis.IntegrationSite_synchronize(reset=True, synchronization_list=['sale_order_module',], self.oxatis.IntegrationSite_synchronize(reset=True, synchronization_list=['sale_order_module',],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
# Check fix point # Check fix point
...@@ -594,14 +581,12 @@ class TestOxatisSynchronization(ERP5TypeTestCase): ...@@ -594,14 +581,12 @@ class TestOxatisSynchronization(ERP5TypeTestCase):
# Change date # Change date
self.oxatis.edit(stop_date="2010/12/31") self.oxatis.edit(stop_date="2010/12/31")
transaction.commit()
self.tic() self.tic()
# run synchronization # run synchronization
self.oxatis.IntegrationSite_synchronize(reset=False, self.oxatis.IntegrationSite_synchronize(reset=False,
synchronization_list=['sale_order_module',], synchronization_list=['sale_order_module',],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
self.checkConflicts('sale_order_module') self.checkConflicts('sale_order_module')
# Check fix point # Check fix point
......
71 72
\ No newline at end of file \ No newline at end of file
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
############################################################################## ##############################################################################
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
import transaction
import unittest import unittest
from zLOG import LOG from zLOG import LOG
from Testing import ZopeTestCase from Testing import ZopeTestCase
...@@ -105,7 +104,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -105,7 +104,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
if sync.getValidationState() != "validated": if sync.getValidationState() != "validated":
sync.validate() sync.validate()
transaction.commit()
self.tic() self.tic()
def beforeTearDown(self): def beforeTearDown(self):
...@@ -115,7 +113,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -115,7 +113,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
for connector in self.ubercart.contentValues(portal_type="Web Service Connector"): for connector in self.ubercart.contentValues(portal_type="Web Service Connector"):
# use the test connector # use the test connector
connector.setTransport("ubercart") connector.setTransport("ubercart")
transaction.commit()
self.tic() self.tic()
...@@ -125,12 +122,10 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -125,12 +122,10 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
for im in ['organisation_module','delivered_organisation_module',\ for im in ['organisation_module','delivered_organisation_module',\
'person_module', 'delivered_person_module']: 'person_module', 'delivered_person_module']:
LOG("RUNNING SYNCHRO FOR %s" %(im), 300, "") LOG("RUNNING SYNCHRO FOR %s" %(im), 300, "")
transaction.commit()
self.tic() self.tic()
self.ubercart.IntegrationSite_synchronize(reset=reset, synchronization_list=[im,], self.ubercart.IntegrationSite_synchronize(reset=reset, synchronization_list=[im,],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
if conflict_dict and conflict_dict.has_key(im): if conflict_dict and conflict_dict.has_key(im):
nb_pub_conflict, nb_sub_conflict, in_conflict = conflict_dict[im] nb_pub_conflict, nb_sub_conflict, in_conflict = conflict_dict[im]
...@@ -155,13 +150,11 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -155,13 +150,11 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
def _runAndCheckResourceSynchronization(self, reset=True, conflict_dict=None): def _runAndCheckResourceSynchronization(self, reset=True, conflict_dict=None):
# run synchronization # run synchronization
transaction.commit()
self.tic() self.tic()
LOG("RUNNING SYNCHRO FOR product_module", 300, "") LOG("RUNNING SYNCHRO FOR product_module", 300, "")
self.ubercart.IntegrationSite_synchronize(reset=reset, synchronization_list=['product_module',], self.ubercart.IntegrationSite_synchronize(reset=reset, synchronization_list=['product_module',],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
# Check fix point # Check fix point
for im in ['product_module',]: for im in ['product_module',]:
...@@ -212,7 +205,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -212,7 +205,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
if person.getId() != self.default_node_id and person.getValidationState() != "validated": if person.getId() != self.default_node_id and person.getValidationState() != "validated":
person.validate() person.validate()
transaction.commit()
self.tic() self.tic()
# Check initial data # Check initial data
self.assertEqual(len(ubercart_test_module.contentValues(portal_type="Ubercart Test Person")), 2) self.assertEqual(len(ubercart_test_module.contentValues(portal_type="Ubercart Test Person")), 2)
...@@ -391,13 +383,11 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -391,13 +383,11 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
prod_ids = [x for x in self.portal.product_module.objectIds() if x != self.default_resource_id] prod_ids = [x for x in self.portal.product_module.objectIds() if x != self.default_resource_id]
self.portal.product_module.manage_delObjects(prod_ids) self.portal.product_module.manage_delObjects(prod_ids)
transaction.commit()
self.tic() self.tic()
# Check initial data # Check initial data
for product in self.portal.ubercart_test_module.contentValues(portal_type="Ubercart Test Product"): for product in self.portal.ubercart_test_module.contentValues(portal_type="Ubercart Test Product"):
if product.getValidationState() != "validated": if product.getValidationState() != "validated":
product.validate() product.validate()
transaction.commit()
self.tic() self.tic()
self.assertEqual(len(self.portal.ubercart_test_module.contentValues(portal_type="Ubercart Test Product", self.assertEqual(len(self.portal.ubercart_test_module.contentValues(portal_type="Ubercart Test Product",
...@@ -463,7 +453,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -463,7 +453,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
if product_test.getTitle() == "Fleure": if product_test.getTitle() == "Fleure":
flower_test = product_test flower_test = product_test
flower_test.objectValues()[0].setCategory("Catalog/Fleure/Rose") flower_test.objectValues()[0].setCategory("Catalog/Fleure/Rose")
transaction.commit()
self.tic() self.tic()
...@@ -485,7 +474,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -485,7 +474,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
if flower is not None and flower_test is not None: if flower is not None and flower_test is not None:
deleted_cat_list = [c.getId() for c in flower_test.objectValues()] deleted_cat_list = [c.getId() for c in flower_test.objectValues()]
flower_test.manage_delObjects(deleted_cat_list) flower_test.manage_delObjects(deleted_cat_list)
transaction.commit()
self.tic() self.tic()
tiosafe_category_list = flower.contentValues() tiosafe_category_list = flower.contentValues()
plugin_category_list = flower_test.contentValues() plugin_category_list = flower_test.contentValues()
...@@ -507,7 +495,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -507,7 +495,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
piv = flower.newContent(portal_type="Product Individual Variation") piv = flower.newContent(portal_type="Product Individual Variation")
piv.setTitle("Fleure/Calice") piv.setTitle("Fleure/Calice")
piv.setVariationBaseCategory("collection") piv.setVariationBaseCategory("collection")
transaction.commit()
self.tic() self.tic()
if flower is not None and flower_test is not None: if flower is not None and flower_test is not None:
...@@ -533,7 +520,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -533,7 +520,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
if flower is not None and flower_test is not None: if flower is not None and flower_test is not None:
flower.objectValues()[0].setTitle("Fleure/Samanta/Ndiondome") flower.objectValues()[0].setTitle("Fleure/Samanta/Ndiondome")
flower.objectValues()[0].setVariationBaseCategory("collection") flower.objectValues()[0].setVariationBaseCategory("collection")
transaction.commit()
self.tic() self.tic()
category = flower.objectValues()[0].getTitle() category = flower.objectValues()[0].getTitle()
category_test = flower_test.objectValues()[0].getCategory() category_test = flower_test.objectValues()[0].getCategory()
...@@ -603,7 +589,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -603,7 +589,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
self.portal.sale_order_module.manage_delObjects(so_ids) self.portal.sale_order_module.manage_delObjects(so_ids)
# Define date on integration site # Define date on integration site
self.ubercart.edit(stop_date="2010/12/01") self.ubercart.edit(stop_date="2010/12/01")
transaction.commit()
self.tic() self.tic()
# Check initial data # Check initial data
self.assertEqual(len(self.portal.ubercart_test_module.contentValues(portal_type="Ubercart Test Sale Order")), 1) self.assertEqual(len(self.portal.ubercart_test_module.contentValues(portal_type="Ubercart Test Sale Order")), 1)
...@@ -616,7 +601,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -616,7 +601,6 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
# run synchronization # run synchronization
self.ubercart.IntegrationSite_synchronize(reset=True, synchronization_list=['sale_order_module',], self.ubercart.IntegrationSite_synchronize(reset=True, synchronization_list=['sale_order_module',],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
# Check fix point # Check fix point
...@@ -650,13 +634,11 @@ class TestUbercartSynchronization(ERP5TypeTestCase): ...@@ -650,13 +634,11 @@ class TestUbercartSynchronization(ERP5TypeTestCase):
self.assertNotEqual(sale_order.getDestinationAdministration(), None) self.assertNotEqual(sale_order.getDestinationAdministration(), None)
# Change date # Change date
self.ubercart.edit(stop_date="2010/10/31") self.ubercart.edit(stop_date="2010/10/31")
transaction.commit()
self.tic() self.tic()
# run synchronization # run synchronization
self.ubercart.IntegrationSite_synchronize(reset=False, synchronization_list=['sale_order_module',], self.ubercart.IntegrationSite_synchronize(reset=False, synchronization_list=['sale_order_module',],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
self.checkConflicts('sale_order_module') self.checkConflicts('sale_order_module')
# Check fix point # Check fix point
......
31 32
\ No newline at end of file \ No newline at end of file
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
############################################################################## ##############################################################################
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
import transaction
import unittest import unittest
from zLOG import LOG from zLOG import LOG
from Testing import ZopeTestCase from Testing import ZopeTestCase
...@@ -106,7 +105,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -106,7 +105,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
if sync.getValidationState() != "validated": if sync.getValidationState() != "validated":
sync.validate() sync.validate()
transaction.commit()
self.tic() self.tic()
def beforeTearDown(self): def beforeTearDown(self):
...@@ -116,7 +114,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -116,7 +114,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
for connector in self.virtuemart.contentValues(portal_type="Web Service Connector"): for connector in self.virtuemart.contentValues(portal_type="Web Service Connector"):
# use the test connector # use the test connector
connector.setTransport("virtuemart") connector.setTransport("virtuemart")
transaction.commit()
self.tic() self.tic()
...@@ -130,12 +127,10 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -130,12 +127,10 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
node_module_list = ['person_module', 'delivered_person_module',] node_module_list = ['person_module', 'delivered_person_module',]
for im in node_module_list: for im in node_module_list:
LOG("RUNNING SYNCHRO FOR %s" %(im), 300, "") LOG("RUNNING SYNCHRO FOR %s" %(im), 300, "")
transaction.commit()
self.tic() self.tic()
self.virtuemart.IntegrationSite_synchronize(reset=reset, synchronization_list=[im,], self.virtuemart.IntegrationSite_synchronize(reset=reset, synchronization_list=[im,],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
if conflict_dict and conflict_dict.has_key(im): if conflict_dict and conflict_dict.has_key(im):
nb_pub_conflict, nb_sub_conflict, in_conflict = conflict_dict[im] nb_pub_conflict, nb_sub_conflict, in_conflict = conflict_dict[im]
...@@ -161,12 +156,10 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -161,12 +156,10 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
def _runAndCheckResourceSynchronization(self, conflict_dict=None, reset=True): def _runAndCheckResourceSynchronization(self, conflict_dict=None, reset=True):
# run synchronization # run synchronization
transaction.commit()
self.tic() self.tic()
self.virtuemart.IntegrationSite_synchronize(reset=reset, synchronization_list=['product_module',], self.virtuemart.IntegrationSite_synchronize(reset=reset, synchronization_list=['product_module',],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
# Check fix point # Check fix point
for im in ['product_module']: for im in ['product_module']:
...@@ -216,7 +209,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -216,7 +209,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
if organisation.getValidationState() != "validated": if organisation.getValidationState() != "validated":
organisation.validate() organisation.validate()
transaction.commit()
self.tic() self.tic()
# Check initial data # Check initial data
self.assertEqual(len(self.portal.virtuemart_test_module.contentValues(portal_type="Virtuemart Test Organisation")), 3) self.assertEqual(len(self.portal.virtuemart_test_module.contentValues(portal_type="Virtuemart Test Organisation")), 3)
...@@ -376,7 +368,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -376,7 +368,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
if person.getValidationState() != "validated": if person.getValidationState() != "validated":
person.validate() person.validate()
transaction.commit()
self.tic() self.tic()
# Check initial data # Check initial data
self.assertEqual(len(self.portal.virtuemart_test_module.contentValues(portal_type="Virtuemart Test Person")), 4) self.assertEqual(len(self.portal.virtuemart_test_module.contentValues(portal_type="Virtuemart Test Person")), 4)
...@@ -500,7 +491,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -500,7 +491,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
for person in self.portal.virtuemart_test_module.contentValues(portal_type="Virtuemart Test Person"): for person in self.portal.virtuemart_test_module.contentValues(portal_type="Virtuemart Test Person"):
if person.getTitle() == "Simple person": if person.getTitle() == "Simple person":
person.edit(city=person_in_orga_update_dict['city']) person.edit(city=person_in_orga_update_dict['city'])
transaction.commit()
self.tic() self.tic()
#self._runAndCheckNodeSynchronization(reset=False) #self._runAndCheckNodeSynchronization(reset=False)
...@@ -559,7 +549,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -559,7 +549,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
elif product.getValidationState() != 'validated': elif product.getValidationState() != 'validated':
product.validate() product.validate()
transaction.commit()
self.tic() self.tic()
# Check initial data # Check initial data
...@@ -567,7 +556,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -567,7 +556,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
if product.getValidationState() != "validated": if product.getValidationState() != "validated":
product.validate() product.validate()
transaction.commit()
self.tic() self.tic()
self.assertEqual(len(self.portal.virtuemart_test_module.contentValues(portal_type="Virtuemart Test Product", self.assertEqual(len(self.portal.virtuemart_test_module.contentValues(portal_type="Virtuemart Test Product",
...@@ -637,7 +625,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -637,7 +625,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
new_product = self.portal.product_module.newContent(portal_type='Product') new_product = self.portal.product_module.newContent(portal_type='Product')
new_product.edit(**erp5_new_product) new_product.edit(**erp5_new_product)
new_product.validate() new_product.validate()
transaction.commit()
self.tic() self.tic()
# add to sale supply # add to sale supply
...@@ -671,7 +658,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -671,7 +658,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
if product.getReference() == "PRDNew": if product.getReference() == "PRDNew":
if product.getValidationState() == "validated": if product.getValidationState() == "validated":
product.invalidate() product.invalidate()
transaction.commit()
self.tic() self.tic()
self.assertEqual(len(self.portal.product_module.contentValues()), 6) self.assertEqual(len(self.portal.product_module.contentValues()), 6)
...@@ -690,7 +676,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -690,7 +676,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
attribut.edit(category='Color/white') attribut.edit(category='Color/white')
if attribut.getValidationState() == 'invalidated': if attribut.getValidationState() == 'invalidated':
attribut.validate() attribut.validate()
transaction.commit()
self.tic() self.tic()
self._runAndCheckResourceSynchronization(reset=False) self._runAndCheckResourceSynchronization(reset=False)
self.assertEqual(len(self.portal.product_module.contentValues()), original_product_module_lenght+5) self.assertEqual(len(self.portal.product_module.contentValues()), original_product_module_lenght+5)
...@@ -705,7 +690,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -705,7 +690,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
variation_base_category='colour') variation_base_category='colour')
if attribut.getValidationState() != 'validated': if attribut.getValidationState() != 'validated':
attribut.validate() attribut.validate()
transaction.commit()
self.tic() self.tic()
self._runAndCheckResourceSynchronization(reset=False) self._runAndCheckResourceSynchronization(reset=False)
self.assertEqual(len(self.portal.product_module.contentValues()), original_product_module_lenght+5) self.assertEqual(len(self.portal.product_module.contentValues()), original_product_module_lenght+5)
...@@ -719,7 +703,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -719,7 +703,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
for attribute in product.contentValues(portal_type="Product Individual Variation"): for attribute in product.contentValues(portal_type="Product Individual Variation"):
product.manage_delObjects(ids=[attribute.getId(),]) product.manage_delObjects(ids=[attribute.getId(),])
transaction.commit()
self.tic() self.tic()
self._runAndCheckResourceSynchronization(reset=False) self._runAndCheckResourceSynchronization(reset=False)
...@@ -767,7 +750,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -767,7 +750,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
self.portal.sale_order_module.manage_delObjects(so_ids) self.portal.sale_order_module.manage_delObjects(so_ids)
# Define date on integration site # Define date on integration site
self.virtuemart.edit(stop_date="2010/12/01") self.virtuemart.edit(stop_date="2010/12/01")
transaction.commit()
self.tic() self.tic()
# Check initial data # Check initial data
self.assertEqual(len(self.portal.virtuemart_test_module.contentValues(portal_type="Virtuemart Test Sale Order")), 1) self.assertEqual(len(self.portal.virtuemart_test_module.contentValues(portal_type="Virtuemart Test Sale Order")), 1)
...@@ -785,7 +767,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -785,7 +767,6 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
#sale orders #sale orders
self.virtuemart.IntegrationSite_synchronize(reset=True, synchronization_list=['sale_order_module',], self.virtuemart.IntegrationSite_synchronize(reset=True, synchronization_list=['sale_order_module',],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
# Check fix point # Check fix point
...@@ -823,13 +804,11 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase): ...@@ -823,13 +804,11 @@ class TestVirtuemartSynchronization(ERP5TypeTestCase):
# Change date # Change date
self.virtuemart.edit(stop_date="2010/12/31") self.virtuemart.edit(stop_date="2010/12/31")
transaction.commit()
self.tic() self.tic()
# run synchronization # run synchronization
self.virtuemart.IntegrationSite_synchronize(reset=False, synchronization_list=['sale_order_module',], self.virtuemart.IntegrationSite_synchronize(reset=False, synchronization_list=['sale_order_module',],
batch_mode=True) batch_mode=True)
transaction.commit()
self.tic() self.tic()
self.checkConflicts('sale_order_module') self.checkConflicts('sale_order_module')
# Check fix point # Check fix point
......
19 20
\ No newline at end of file \ No newline at end of file
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeLiveTestCase from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeLiveTestCase
from Products.ERP5Type.tests.utils import createZODBPythonScript from Products.ERP5Type.tests.utils import createZODBPythonScript
import transaction
class TestLiveUpgrader(ERP5TypeLiveTestCase): class TestLiveUpgrader(ERP5TypeLiveTestCase):
""" """
...@@ -144,7 +143,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase): ...@@ -144,7 +143,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase):
createZODBPythonScript(self.getPortal().portal_skins.custom, createZODBPythonScript(self.getPortal().portal_skins.custom,
'ERP5Site_getUpgraderSignature', "item=None", 'ERP5Site_getUpgraderSignature', "item=None",
"return " + str(signature_code)) "return " + str(signature_code))
transaction.commit() self.commit()
self.assertEquals(self.portal.ERP5Site_getUpgraderSignature(), signature_code) self.assertEquals(self.portal.ERP5Site_getUpgraderSignature(), signature_code)
self.assertEquals(self.portal.ERP5Site_upgradeObjectList(), []) self.assertEquals(self.portal.ERP5Site_upgradeObjectList(), [])
test_object = self.portal.portal_categories.newContent(id=self.upgrade_object_test_id, test_object = self.portal.portal_categories.newContent(id=self.upgrade_object_test_id,
...@@ -169,7 +168,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase): ...@@ -169,7 +168,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase):
createZODBPythonScript(self.getPortal().portal_skins.custom, createZODBPythonScript(self.getPortal().portal_skins.custom,
'ERP5Site_getUpgraderSignature', "item=None", 'ERP5Site_getUpgraderSignature', "item=None",
"return " + str(signature_code)) "return " + str(signature_code))
transaction.commit() self.commit()
self.assertEquals(self.portal.ERP5Site_getUpgraderSignature(), signature_code) self.assertEquals(self.portal.ERP5Site_getUpgraderSignature(), signature_code)
# Nothing to upgrade # Nothing to upgrade
self.assertEquals(self.portal.ERP5Site_upgradeObjectClass(), []) self.assertEquals(self.portal.ERP5Site_upgradeObjectClass(), [])
...@@ -188,7 +187,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase): ...@@ -188,7 +187,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase):
to_class_as_string, to_class_as_string,
test_script) test_script)
transaction.commit() self.commit()
self.assertNotEquals(self.portal.ERP5Site_upgradeObjectClass(), []) self.assertNotEquals(self.portal.ERP5Site_upgradeObjectClass(), [])
self.assertEquals(self.portal.ERP5Site_upgradeObjectClass(upgrade=1), self.assertEquals(self.portal.ERP5Site_upgradeObjectClass(upgrade=1),
[(gadget.getRelativeUrl(), 'ERP5 Gadget')]) [(gadget.getRelativeUrl(), 'ERP5 Gadget')])
...@@ -206,7 +205,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase): ...@@ -206,7 +205,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase):
createZODBPythonScript(self.getPortal().portal_skins.custom, createZODBPythonScript(self.getPortal().portal_skins.custom,
'ERP5Site_getUpgraderSignature', "item=None", 'ERP5Site_getUpgraderSignature', "item=None",
"return " + str(signature_code)) "return " + str(signature_code))
transaction.commit() self.commit()
self.assertEquals(self.portal.ERP5Site_getUpgraderSignature(), signature_code) self.assertEquals(self.portal.ERP5Site_getUpgraderSignature(), signature_code)
self.assertEquals(self.portal.ERP5Site_upgradeGlobalPropertyList(), self.assertEquals(self.portal.ERP5Site_upgradeGlobalPropertyList(),
["Upgrade Required for Global Properties."]) ["Upgrade Required for Global Properties."])
...@@ -229,7 +228,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase): ...@@ -229,7 +228,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase):
createZODBPythonScript(self.getPortal().portal_skins.custom, createZODBPythonScript(self.getPortal().portal_skins.custom,
'ERP5Site_getUpgraderSignature', "item=None", 'ERP5Site_getUpgraderSignature', "item=None",
"return " + str(signature_code)) "return " + str(signature_code))
transaction.commit() self.commit()
self.assertEquals(self.portal.ERP5Site_upgradeWorkflowChain(), []) self.assertEquals(self.portal.ERP5Site_upgradeWorkflowChain(), [])
...@@ -275,7 +274,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase): ...@@ -275,7 +274,7 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase):
createZODBPythonScript(self.getPortal().portal_skins.custom, createZODBPythonScript(self.getPortal().portal_skins.custom,
'ERP5Site_getUpgraderSignature', "item=None", 'ERP5Site_getUpgraderSignature', "item=None",
"return " + str(signature_code)) "return " + str(signature_code))
transaction.commit() self.commit()
self.assertEquals(self.portal.ERP5Site_getUpgraderSignature(), signature_code) self.assertEquals(self.portal.ERP5Site_getUpgraderSignature(), signature_code)
self.assertEquals(self.portal.ERP5Site_upgradePortalTypePropertySheet(), self.assertEquals(self.portal.ERP5Site_upgradePortalTypePropertySheet(),
["Person doesn't has Account associated."]) ["Person doesn't has Account associated."])
...@@ -294,14 +293,14 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase): ...@@ -294,14 +293,14 @@ class TestLiveUpgrader(ERP5TypeLiveTestCase):
'ERP5Site_testRecreateActivityScript', "", 'ERP5Site_testRecreateActivityScript', "",
"context.manage_addProperty('custom_property_without_meaning', 'I was there', 'string')") "context.manage_addProperty('custom_property_without_meaning', 'I was there', 'string')")
transaction.commit() self.commit()
object_to_test.activate().ERP5Site_testRecreateActivityScript() object_to_test.activate().ERP5Site_testRecreateActivityScript()
transaction.commit() self.commit()
# Verify if the final activity is created. # Verify if the final activity is created.
self.assertTrue(object_to_test.hasActivity(method_id="ERP5Site_testRecreateActivityScript")) self.assertTrue(object_to_test.hasActivity(method_id="ERP5Site_testRecreateActivityScript"))
self.portal.portal_activities.activate().ERP5Site_clearActivities() self.portal.portal_activities.activate().ERP5Site_clearActivities()
transaction.commit() self.commit()
self.assertTrue(object_to_test.hasActivity(method_id="ERP5Site_testRecreateActivityScript")) self.assertTrue(object_to_test.hasActivity(method_id="ERP5Site_testRecreateActivityScript"))
self.assertTrue(self.portal.portal_activities.hasActivity(method_id='ERP5Site_clearActivities')) self.assertTrue(self.portal.portal_activities.hasActivity(method_id='ERP5Site_clearActivities'))
self.stepTic() self.stepTic()
......
594 595
\ No newline at end of file \ No newline at end of file
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
############################################################################## ##############################################################################
import transaction
import httplib import httplib
import urlparse import urlparse
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
...@@ -87,7 +86,6 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase): ...@@ -87,7 +86,6 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
self.assertEqual(result, httplib.CREATED) self.assertEqual(result, httplib.CREATED)
self.assertEqual(data, self.key) self.assertEqual(data, self.key)
transaction.commit()
self.tic() self.tic()
document = self.portal.portal_catalog.getResultValue(reference=self.key) document = self.portal.portal_catalog.getResultValue(reference=self.key)
...@@ -106,7 +104,6 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase): ...@@ -106,7 +104,6 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
self.assertEqual(result, httplib.CREATED) self.assertEqual(result, httplib.CREATED)
self.assertEqual(data, self.key) self.assertEqual(data, self.key)
transaction.commit()
self.tic() self.tic()
document = self.portal.portal_catalog.getResultValue(reference=self.key) document = self.portal.portal_catalog.getResultValue(reference=self.key)
...@@ -121,13 +118,11 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase): ...@@ -121,13 +118,11 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
Check if is allowed to put the same file twice. Check if is allowed to put the same file twice.
""" """
self.postFile() self.postFile()
transaction.commit()
self.tic() self.tic()
document = self.portal.portal_catalog.getResultValue(reference=self.key) document = self.portal.portal_catalog.getResultValue(reference=self.key)
self.assertEquals('published', document.getValidationState()) self.assertEquals('published', document.getValidationState())
self.postFile() self.postFile()
transaction.commit()
self.tic() self.tic()
self.assertEquals(2, self.portal.portal_catalog.countResults( self.assertEquals(2, self.portal.portal_catalog.countResults(
reference=self.key)[0][0]) reference=self.key)[0][0])
...@@ -140,9 +135,8 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase): ...@@ -140,9 +135,8 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
@expectedFailure @expectedFailure
def test_put_file_twice_no_tic(self): def test_put_file_twice_no_tic(self):
self.postFile() self.postFile()
transaction.commit() self.commit()
self.postFile() self.postFile()
transaction.commit()
self.tic() self.tic()
document_list = self.portal.portal_catalog(reference=self.key) document_list = self.portal.portal_catalog(reference=self.key)
......
63 64
\ No newline at end of file \ No newline at end of file
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
import httplib import httplib
import urlparse import urlparse
import json import json
import transaction
import random import random
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from ShaDirMixin import ShaDirMixin from ShaDirMixin import ShaDirMixin
...@@ -90,7 +89,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -90,7 +89,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
folder = self.portal[module] folder = self.portal[module]
folder.manage_delObjects(list(folder.objectIds())) folder.manage_delObjects(list(folder.objectIds()))
self.portal.portal_caches.clearAllCache() self.portal.portal_caches.clearAllCache()
transaction.commit()
self.tic() self.tic()
def test_post_information(self): def test_post_information(self):
...@@ -98,7 +96,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -98,7 +96,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
Check if posting information is working. Check if posting information is working.
""" """
self.postInformation() self.postInformation()
transaction.commit()
self.tic() self.tic()
# Asserting Data Set # Asserting Data Set
...@@ -125,7 +122,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -125,7 +122,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
""" """
self.postInformation() self.postInformation()
transaction.commit()
self.tic() self.tic()
result, data = self.getInformation() result, data = self.getInformation()
...@@ -141,11 +137,9 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -141,11 +137,9 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
Check if posting information is working. Check if posting information is working.
""" """
self.postInformation() self.postInformation()
transaction.commit()
self.tic() self.tic()
self.postInformation() self.postInformation()
transaction.commit()
self.tic() self.tic()
self.assertEqual(1, self.portal.portal_catalog.countResults( self.assertEqual(1, self.portal.portal_catalog.countResults(
...@@ -175,10 +169,9 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -175,10 +169,9 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
Check if posting information is working. Check if posting information is working.
""" """
self.postInformation() self.postInformation()
transaction.commit() self.commit()
self.postInformation() self.postInformation()
transaction.commit()
self.tic() self.tic()
self.assertEqual(1, self.portal.portal_catalog.countResults( self.assertEqual(1, self.portal.portal_catalog.countResults(
...@@ -200,7 +193,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -200,7 +193,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
check if return the temp document with text content. check if return the temp document with text content.
""" """
self.postInformation() self.postInformation()
transaction.commit()
self.tic() self.tic()
result, data = self.getInformation() result, data = self.getInformation()
...@@ -221,7 +213,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -221,7 +213,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
This relation is controlled by Data Set object. This relation is controlled by Data Set object.
""" """
self.postInformation() self.postInformation()
transaction.commit()
self.tic() self.tic()
urlmd5_2 = 'anotherurlmd5' + str(random.random()) urlmd5_2 = 'anotherurlmd5' + str(random.random())
...@@ -237,7 +228,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -237,7 +228,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
"User SIGNATURE goes here."] "User SIGNATURE goes here."]
data_2 = json.dumps(data_list_2) data_2 = json.dumps(data_list_2)
self.postInformation(key_2, data_2) self.postInformation(key_2, data_2)
transaction.commit()
self.tic() self.tic()
self.assertEquals(2, len(self.portal.data_set_module)) self.assertEquals(2, len(self.portal.data_set_module))
...@@ -250,7 +240,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -250,7 +240,6 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
self.assertEquals(1, len(json.loads(document2))) self.assertEquals(1, len(json.loads(document2)))
self.postInformation() self.postInformation()
transaction.commit()
self.tic() self.tic()
self.assertEquals(2, len(self.portal.data_set_module)) self.assertEquals(2, len(self.portal.data_set_module))
self.assertEquals(3, len(self.portal.document_module)) self.assertEquals(3, len(self.portal.document_module))
......
70 71
\ No newline at end of file \ No newline at end of file
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
import base64 import base64
import transaction
import httplib import httplib
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
...@@ -87,7 +86,6 @@ class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase): ...@@ -87,7 +86,6 @@ class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase):
try: try:
connection.request('POST', self.path, self.data, self.header_dict) connection.request('POST', self.path, self.data, self.header_dict)
result = connection.getresponse() result = connection.getresponse()
transaction.commit()
self.tic() self.tic()
data = result.read() data = result.read()
finally: finally:
...@@ -144,7 +142,6 @@ class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase): ...@@ -144,7 +142,6 @@ class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase):
try: try:
connection.request('POST', self.path, self.data, header_dict) connection.request('POST', self.path, self.data, header_dict)
result = connection.getresponse() result = connection.getresponse()
transaction.commit()
self.tic() self.tic()
finally: finally:
connection.close() connection.close()
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
############################################################################## ##############################################################################
import transaction
from AccessControl import Unauthorized from AccessControl import Unauthorized
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from ShaCacheMixin import ShaCacheMixin from ShaCacheMixin import ShaCacheMixin
...@@ -73,7 +72,6 @@ class TestShaCacheSecurity(ShaCacheMixin, ShaSecurityMixin, SecurityTestCase): ...@@ -73,7 +72,6 @@ class TestShaCacheSecurity(ShaCacheMixin, ShaSecurityMixin, SecurityTestCase):
'document_module',): 'document_module',):
folder = self.portal[module] folder = self.portal[module]
folder.manage_delObjects(list(folder.objectIds())) folder.manage_delObjects(list(folder.objectIds()))
transaction.commit()
self.tic() self.tic()
# Tests # Tests
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
import base64 import base64
import json import json
import os import os
import transaction
import httplib import httplib
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeTestCase
...@@ -87,7 +86,6 @@ class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeTestCase): ...@@ -87,7 +86,6 @@ class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeTestCase):
try: try:
connection.request('PUT', self.path, self.data, self.header_dict) connection.request('PUT', self.path, self.data, self.header_dict)
result = connection.getresponse() result = connection.getresponse()
transaction.commit()
self.tic() self.tic()
data = result.read() data = result.read()
finally: finally:
...@@ -149,7 +147,6 @@ class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeTestCase): ...@@ -149,7 +147,6 @@ class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeTestCase):
try: try:
connection.request('PUT', self.path, self.data, header_dict) connection.request('PUT', self.path, self.data, header_dict)
result = connection.getresponse() result = connection.getresponse()
transaction.commit()
self.tic() self.tic()
finally: finally:
connection.close() connection.close()
...@@ -171,7 +168,6 @@ class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeTestCase): ...@@ -171,7 +168,6 @@ class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeTestCase):
try: try:
connection.request('PUT', self.path, data, self.header_dict) connection.request('PUT', self.path, data, self.header_dict)
result = connection.getresponse() result = connection.getresponse()
transaction.commit()
self.tic() self.tic()
data = result.read() data = result.read()
finally: finally:
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
############################################################################## ##############################################################################
import transaction
from AccessControl import Unauthorized from AccessControl import Unauthorized
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from ShaDirMixin import ShaDirMixin from ShaDirMixin import ShaDirMixin
...@@ -70,7 +69,6 @@ class TestShaDirSecurity(ShaDirMixin, ShaSecurityMixin, SecurityTestCase): ...@@ -70,7 +69,6 @@ class TestShaDirSecurity(ShaDirMixin, ShaSecurityMixin, SecurityTestCase):
'document_module',): 'document_module',):
folder = self.portal[module] folder = self.portal[module]
folder.manage_delObjects(list(folder.objectIds())) folder.manage_delObjects(list(folder.objectIds()))
transaction.commit()
self.tic() self.tic()
# Tests # Tests
......
26 27
\ No newline at end of file \ No newline at end of file
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
import unittest import unittest
import urllib import urllib
import transaction
import ZODB import ZODB
from ZODB.DemoStorage import DemoStorage from ZODB.DemoStorage import DemoStorage
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
...@@ -111,16 +110,16 @@ class TestERP5(ERP5TypeTestCase): ...@@ -111,16 +110,16 @@ class TestERP5(ERP5TypeTestCase):
cookie_name = self._testMethodName cookie_name = self._testMethodName
portal = self.portal portal = self.portal
self.assertEqual(0, portal.getCacheCookie(cookie_name)) self.assertEqual(0, portal.getCacheCookie(cookie_name))
transaction.commit() self.commit()
portal.newCacheCookie(cookie_name) # 1 portal.newCacheCookie(cookie_name) # 1
self.other_node.newCacheCookie(cookie_name) # 1 self.other_node.newCacheCookie(cookie_name) # 1
self.other_node.newCacheCookie(cookie_name) # 2 self.other_node.newCacheCookie(cookie_name) # 2
transaction.commit() # max(1, 2) + 1 self.commit()# max(1, 2) + 1
self.assertEqual(3, portal.getCacheCookie(cookie_name)) self.assertEqual(3, portal.getCacheCookie(cookie_name))
def testActiveProcess(self): def testActiveProcess(self):
active_process = self.portal.portal_activities.newActiveProcess() active_process = self.portal.portal_activities.newActiveProcess()
transaction.commit() self.commit()
remote = self.other_node remote = self.other_node
for id in active_process.getRelativeUrl().split('/'): for id in active_process.getRelativeUrl().split('/'):
remote = getattr(remote, id) remote = getattr(remote, id)
...@@ -128,9 +127,9 @@ class TestERP5(ERP5TypeTestCase): ...@@ -128,9 +127,9 @@ class TestERP5(ERP5TypeTestCase):
active_process.postResult(x) active_process.postResult(x)
remote.testActiveProcess_postResult(100) remote.testActiveProcess_postResult(100)
try: try:
transaction.commit() self.commit()
except: except:
transaction.abort() # make failure more readable in case of regression self.abort() # make failure more readable in case of regression
raise raise
self.assertEqual(sorted(active_process.getResultList()), range(101)) self.assertEqual(sorted(active_process.getResultList()), range(101))
......
1 2
\ No newline at end of file \ No newline at end of file
...@@ -32,7 +32,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase ...@@ -32,7 +32,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Testing.ZopeTestCase.PortalTestCase import PortalTestCase from Testing.ZopeTestCase.PortalTestCase import PortalTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager from AccessControl.SecurityManagement import noSecurityManager
import transaction
class TestCMFCategory(ERP5TypeTestCase): class TestCMFCategory(ERP5TypeTestCase):
...@@ -379,13 +378,11 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -379,13 +378,11 @@ class TestCMFCategory(ERP5TypeTestCase):
p2 = self.getPersonModule()._getOb(self.id2) p2 = self.getPersonModule()._getOb(self.id2)
o1 = self.getOrganisationModule()._getOb(self.id1) o1 = self.getOrganisationModule()._getOb(self.id1)
p1.setGenderValue(o1) p1.setGenderValue(o1)
transaction.commit() self.tic()# This is required
self.tic() # This is required
self.assertEqual(p1.getGenderValue(),o1) self.assertEqual(p1.getGenderValue(),o1)
self.assertEqual(o1.getGenderRelatedValueList(),[p1]) self.assertEqual(o1.getGenderRelatedValueList(),[p1])
p2.setGenderValue(o1) # reindex implicit p2.setGenderValue(o1) # reindex implicit
transaction.commit()
self.tic() self.tic()
self.assertEqual(len(o1.getGenderRelatedValueList()),2) self.assertEqual(len(o1.getGenderRelatedValueList()),2)
...@@ -397,12 +394,10 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -397,12 +394,10 @@ class TestCMFCategory(ERP5TypeTestCase):
p1 = self.getPersonModule()._getOb(self.id1) p1 = self.getPersonModule()._getOb(self.id1)
p1.setRegion('europe/west/france') p1.setRegion('europe/west/france')
transaction.commit()
self.tic() self.tic()
west = self.portal.portal_categories.resolveCategory('region/europe/west') west = self.portal.portal_categories.resolveCategory('region/europe/west')
west.setId("ouest") west.setId("ouest")
transaction.commit()
self.tic() self.tic()
self.assertEqual(west, self.assertEqual(west,
...@@ -417,14 +412,12 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -417,14 +412,12 @@ class TestCMFCategory(ERP5TypeTestCase):
p1 = self.getPersonModule()._getOb(self.id1) p1 = self.getPersonModule()._getOb(self.id1)
p1.setRegion('europe/west/france') p1.setRegion('europe/west/france')
transaction.commit()
self.tic() self.tic()
europe = self.portal.portal_categories.resolveCategory('region/europe') europe = self.portal.portal_categories.resolveCategory('region/europe')
west = europe.west west = europe.west
cb_data = europe.manage_cutObjects(['west']) cb_data = europe.manage_cutObjects(['west'])
self.portal.portal_categories.region.manage_pasteObjects(cb_data) self.portal.portal_categories.region.manage_pasteObjects(cb_data)
transaction.commit()
self.tic() self.tic()
self.assertEqual(west, self.assertEqual(west,
...@@ -439,14 +432,12 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -439,14 +432,12 @@ class TestCMFCategory(ERP5TypeTestCase):
p1 = self.getPersonModule()._getOb(self.id1) p1 = self.getPersonModule()._getOb(self.id1)
p1.setRegion('europe/west/france') p1.setRegion('europe/west/france')
transaction.commit()
self.tic() self.tic()
europe = self.portal.portal_categories.resolveCategory('region/europe') europe = self.portal.portal_categories.resolveCategory('region/europe')
west = europe.west west = europe.west
cb_data = europe.manage_copyObjects(['west']) cb_data = europe.manage_copyObjects(['west'])
self.portal.portal_categories.region.manage_pasteObjects(cb_data) self.portal.portal_categories.region.manage_pasteObjects(cb_data)
transaction.commit()
self.tic() self.tic()
self.assertEqual(west, self.assertEqual(west,
...@@ -535,7 +526,6 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -535,7 +526,6 @@ class TestCMFCategory(ERP5TypeTestCase):
pc = self.getCategoriesTool() pc = self.getCategoriesTool()
bc = pc.newContent(portal_type='Base Category', id='related_value_test') bc = pc.newContent(portal_type='Base Category', id='related_value_test')
self.failUnless(bc is not None) self.failUnless(bc is not None)
transaction.commit()
self.tic() self.tic()
# A newly created base category should be referred to only by itself # A newly created base category should be referred to only by itself
value_list = pc.getRelatedValueList(bc) value_list = pc.getRelatedValueList(bc)
...@@ -543,7 +533,6 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -543,7 +533,6 @@ class TestCMFCategory(ERP5TypeTestCase):
c = bc.newContent(portal_type='Category', id='1') c = bc.newContent(portal_type='Category', id='1')
self.failUnless(c is not None) self.failUnless(c is not None)
transaction.commit()
self.tic() self.tic()
value_list = pc.getRelatedValueList(bc) value_list = pc.getRelatedValueList(bc)
# Now the base category should be referred to by itself and this sub category # Now the base category should be referred to by itself and this sub category
...@@ -557,7 +546,6 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -557,7 +546,6 @@ class TestCMFCategory(ERP5TypeTestCase):
org = self.portal.organisation_module.newContent( org = self.portal.organisation_module.newContent(
id='organisation_test', id='organisation_test',
destination='person_module/person_test') destination='person_module/person_test')
transaction.commit()
self.tic() self.tic()
self.assertEquals(person.getDefaultDestinationRelated(), self.assertEquals(person.getDefaultDestinationRelated(),
'organisation_module/organisation_test' ) 'organisation_module/organisation_test' )
...@@ -572,7 +560,6 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -572,7 +560,6 @@ class TestCMFCategory(ERP5TypeTestCase):
obj = self.getOrganisationModule().newContent( obj = self.getOrganisationModule().newContent(
portal_type = 'Organisation') portal_type = 'Organisation')
obj.setCategoryList(['test_base_cat/test_cat']) obj.setCategoryList(['test_base_cat/test_cat'])
transaction.commit()
self.tic() self.tic()
self.assert_(obj in [x.getObject() for x in test.getCategoryMemberValueList()]) self.assert_(obj in [x.getObject() for x in test.getCategoryMemberValueList()])
...@@ -605,7 +592,6 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -605,7 +592,6 @@ class TestCMFCategory(ERP5TypeTestCase):
organisation = self.getOrganisationModule().newContent( organisation = self.getOrganisationModule().newContent(
portal_type='Organisation', region='west/france') portal_type='Organisation', region='west/france')
transaction.commit()
self.tic() self.tic()
self.assertEquals([x.getObject() for x in self.assertEquals([x.getObject() for x in
...@@ -949,7 +935,6 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -949,7 +935,6 @@ class TestCMFCategory(ERP5TypeTestCase):
bc = self.portal.portal_categories.newContent( bc = self.portal.portal_categories.newContent(
portal_type='Base Category', portal_type='Base Category',
id='first_id') id='first_id')
transaction.commit()
self.tic() self.tic()
bc.setId('new_id') bc.setId('new_id')
self.assertEquals('new_id', bc.getId()) self.assertEquals('new_id', bc.getId())
...@@ -964,7 +949,6 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -964,7 +949,6 @@ class TestCMFCategory(ERP5TypeTestCase):
self.assertNotEquals(line, None) self.assertNotEquals(line, None)
cell = line.newContent(id='baz', portal_type='Sale Order Cell') cell = line.newContent(id='baz', portal_type='Sale Order Cell')
self.assertNotEquals(cell, None) self.assertNotEquals(cell, None)
transaction.commit()
self.tic() self.tic()
for relative_url, value in ( for relative_url, value in (
...@@ -994,7 +978,7 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -994,7 +978,7 @@ class TestCMFCategory(ERP5TypeTestCase):
#First remove Base Category #First remove Base Category
self.portal.portal_categories.manage_delObjects(['region']) self.portal.portal_categories.manage_delObjects(['region'])
obj = self.portal.person_module.newContent(portal_type='Person') obj = self.portal.person_module.newContent(portal_type='Person')
transaction.commit() self.commit()
try: try:
#Setters #Setters
self.assertRaises(AttributeError, getattr, obj, 'setRegion') self.assertRaises(AttributeError, getattr, obj, 'setRegion')
...@@ -1010,7 +994,7 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -1010,7 +994,7 @@ class TestCMFCategory(ERP5TypeTestCase):
finally: finally:
#add Base Category #add Base Category
self.portal.portal_categories.newContent(id='region', portal_type='Base Category') self.portal.portal_categories.newContent(id='region', portal_type='Base Category')
transaction.commit() self.commit()
#check Method exists after base_category creation #check Method exists after base_category creation
#Setters #Setters
self.assertTrue(getattr(obj, 'setRegion') is not None) self.assertTrue(getattr(obj, 'setRegion') is not None)
...@@ -1089,7 +1073,6 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -1089,7 +1073,6 @@ class TestCMFCategory(ERP5TypeTestCase):
portal_type='Category'), portal_type='Category'),
['id1']) ['id1'])
# Check indexation # Check indexation
transaction.commit()
self.tic() self.tic()
def test_suite(): def test_suite():
......
This diff is collapsed.
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
import unittest import unittest
import os import os
import transaction
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5.tests.testAccounting import AccountingTestCase from Products.ERP5.tests.testAccounting import AccountingTestCase
...@@ -1096,7 +1095,6 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -1096,7 +1095,6 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
source_credit=400.0))) source_credit=400.0)))
t4.stop() t4.stop()
t4.deliver() t4.deliver()
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
...@@ -1236,7 +1234,6 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -1236,7 +1234,6 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
source_credit=400.0))) source_credit=400.0)))
t4.stop() t4.stop()
t4.deliver() t4.deliver()
transaction.commit()
self.tic() self.tic()
...@@ -3843,7 +3840,6 @@ class TestAccountingReportsWithAnalytic(AccountingTestCase, ERP5ReportTestCase): ...@@ -3843,7 +3840,6 @@ class TestAccountingReportsWithAnalytic(AccountingTestCase, ERP5ReportTestCase):
product_line_value=None, product_line_value=None,
source_credit=700.0), source_credit=700.0),
)) ))
transaction.commit()
self.tic() self.tic()
self.login(self.username) self.login(self.username)
...@@ -3853,7 +3849,7 @@ class TestAccountingReportsWithAnalytic(AccountingTestCase, ERP5ReportTestCase): ...@@ -3853,7 +3849,7 @@ class TestAccountingReportsWithAnalytic(AccountingTestCase, ERP5ReportTestCase):
preference._edit( preference._edit(
preferred_accounting_transaction_line_function_base_category=None, preferred_accounting_transaction_line_function_base_category=None,
preferred_accounting_transaction_line_analytic_base_category_list=()) preferred_accounting_transaction_line_analytic_base_category_list=())
transaction.commit() self.commit()
def testJournalAnalyticsShown(self): def testJournalAnalyticsShown(self):
request_form = self.portal.REQUEST.form request_form = self.portal.REQUEST.form
......
...@@ -43,7 +43,6 @@ way it is used in the invoice related simulation. ...@@ -43,7 +43,6 @@ way it is used in the invoice related simulation.
import unittest import unittest
import random import random
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
...@@ -202,7 +201,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -202,7 +201,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
'default_invoice_transaction_simulation_rule') 'default_invoice_transaction_simulation_rule')
if invoice_transaction_rule.getValidationState() == 'validated': if invoice_transaction_rule.getValidationState() == 'validated':
invoice_transaction_rule.invalidate() invoice_transaction_rule.invalidate()
transaction.commit() self.commit()
# delete anything inside the rule first # delete anything inside the rule first
# clear the message queue, so that it does not contains unexistant paths # clear the message queue, so that it does not contains unexistant paths
...@@ -210,7 +209,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -210,7 +209,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
invoice_transaction_rule.deleteContent( invoice_transaction_rule.deleteContent(
[x for x in invoice_transaction_rule.objectIds()]) [x for x in invoice_transaction_rule.objectIds()])
self.assertEquals(len(invoice_transaction_rule.objectValues()), 0) self.assertEquals(len(invoice_transaction_rule.objectValues()), 0)
transaction.commit() self.commit()
# and add new content, predicate product_line # and add new content, predicate product_line
predicate_product_notebook = invoice_transaction_rule.newContent( predicate_product_notebook = invoice_transaction_rule.newContent(
...@@ -489,7 +488,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -489,7 +488,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
'default_payment_simulation_rule') 'default_payment_simulation_rule')
if payment_rule.getValidationState() == 'validated': if payment_rule.getValidationState() == 'validated':
payment_rule.invalidate() payment_rule.invalidate()
transaction.commit() self.commit()
# delete anything inside the rule first # delete anything inside the rule first
# clear the message queue, so that it does not contains unexistant paths # clear the message queue, so that it does not contains unexistant paths
...@@ -497,7 +496,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -497,7 +496,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
payment_rule.deleteContent( payment_rule.deleteContent(
[x.getId() for x in payment_rule.objectValues( [x.getId() for x in payment_rule.objectValues(
portal_type=['Predicate', self.accounting_rule_cell_portal_type])]) portal_type=['Predicate', self.accounting_rule_cell_portal_type])])
transaction.commit() self.commit()
# and add a new predicate # and add a new predicate
payment_rule.newContent( payment_rule.newContent(
...@@ -531,7 +530,6 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -531,7 +530,6 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
source=line_source_id, source=line_source_id,
destination=line_destination_id) destination=line_destination_id)
payment_rule.validate() payment_rule.validate()
transaction.commit()
self.tic() self.tic()
def stepCreateEmptyInvoice(self, sequence, **kw) : def stepCreateEmptyInvoice(self, sequence, **kw) :
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
import unittest import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
import transaction
from DateTime import DateTime from DateTime import DateTime
class TestAcknowledgementTool(ERP5TypeTestCase): class TestAcknowledgementTool(ERP5TypeTestCase):
...@@ -63,7 +62,6 @@ class TestAcknowledgementTool(ERP5TypeTestCase): ...@@ -63,7 +62,6 @@ class TestAcknowledgementTool(ERP5TypeTestCase):
stop_date = now+2) stop_date = now+2)
portal.portal_workflow.doActionFor(event, 'start_action') portal.portal_workflow.doActionFor(event, 'start_action')
self.assertEqual(event.getSimulationState(), 'started') self.assertEqual(event.getSimulationState(), 'started')
transaction.commit()
self.tic() self.tic()
acknowledgement_tool_kw = {} acknowledgement_tool_kw = {}
...@@ -98,7 +96,7 @@ class TestAcknowledgementTool(ERP5TypeTestCase): ...@@ -98,7 +96,7 @@ class TestAcknowledgementTool(ERP5TypeTestCase):
# the event # the event
self.assertEqual(acknowledgement.getPortalType(), 'Acknowledgement') self.assertEqual(acknowledgement.getPortalType(), 'Acknowledgement')
self.assertEqual(acknowledgement.getTextContent(), "A Nice Message") self.assertEqual(acknowledgement.getTextContent(), "A Nice Message")
transaction.commit() self.commit()
# We should not have any acknowledgements, we just committed previous # We should not have any acknowledgements, we just committed previous
# transaction, this means that we look if the mechanism that looks at # transaction, this means that we look if the mechanism that looks at
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
Most test-cases are based on the testInvoice.py. Most test-cases are based on the testInvoice.py.
""" """
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
...@@ -177,7 +176,6 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase): ...@@ -177,7 +176,6 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
invoice_transaction = invoice.getCausalityRelatedValue() invoice_transaction = invoice.getCausalityRelatedValue()
transaction_line_1 = invoice_transaction.newContent(portal_type=self.invoice_transaction_line_portal_type) transaction_line_1 = invoice_transaction.newContent(portal_type=self.invoice_transaction_line_portal_type)
transaction_line_2 = invoice_transaction.newContent(portal_type=self.invoice_transaction_line_portal_type) transaction_line_2 = invoice_transaction.newContent(portal_type=self.invoice_transaction_line_portal_type)
transaction.commit()
self.tic() self.tic()
transaction_line_1.edit(id ='receivable', source='account_module/customer', transaction_line_1.edit(id ='receivable', source='account_module/customer',
destination='account_module/supplier', quantity=-1665) destination='account_module/supplier', quantity=-1665)
...@@ -392,7 +390,6 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase): ...@@ -392,7 +390,6 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
quantity=10, quantity=10,
price=3) price=3)
invoice.confirm() invoice.confirm()
transaction.commit()
self.tic() self.tic()
odt = invoice.Invoice_viewAsODT() odt = invoice.Invoice_viewAsODT()
...@@ -426,7 +423,7 @@ class TestAdvancedSaleInvoice(TestAdvancedInvoice): ...@@ -426,7 +423,7 @@ class TestAdvancedSaleInvoice(TestAdvancedInvoice):
self.portal.erp5_sql_transactionless_connection.manage_test( self.portal.erp5_sql_transactionless_connection.manage_test(
"delete from portal_ids where \ "delete from portal_ids where \
id_group='Accounting_Transaction_Module-Sale_Invoice_Transaction'") id_group='Accounting_Transaction_Module-Sale_Invoice_Transaction'")
transaction.commit() self.commit()
def stepCheckInvoicesAndTransactionsConsistency(self, sequence=None, sequence_list=None, def stepCheckInvoicesAndTransactionsConsistency(self, sequence=None, sequence_list=None,
**kw): **kw):
...@@ -1138,7 +1135,7 @@ class TestAdvancedPurchaseInvoice(TestAdvancedInvoice): ...@@ -1138,7 +1135,7 @@ class TestAdvancedPurchaseInvoice(TestAdvancedInvoice):
packing_list.start() packing_list.start()
packing_list.stop() packing_list.stop()
self.assertEquals('stopped', packing_list.getSimulationState()) self.assertEquals('stopped', packing_list.getSimulationState())
transaction.commit() self.commit()
class TestWorkflow(SecurityTestCase): class TestWorkflow(SecurityTestCase):
...@@ -1168,7 +1165,6 @@ class TestWorkflow(SecurityTestCase): ...@@ -1168,7 +1165,6 @@ class TestWorkflow(SecurityTestCase):
for role in role_list: for role in role_list:
type_document = sale_invoice_type.newContent(portal_type='Role Information') type_document = sale_invoice_type.newContent(portal_type='Role Information')
type_document.edit(**role) type_document.edit(**role)
transaction.commit()
self.tic() self.tic()
for role in role_list: for role in role_list:
...@@ -1181,7 +1177,6 @@ class TestWorkflow(SecurityTestCase): ...@@ -1181,7 +1177,6 @@ class TestWorkflow(SecurityTestCase):
node = node.newContent(id=category_id, portal_type='Category') node = node.newContent(id=category_id, portal_type='Category')
else: else:
node = node.get(category_id) node = node.get(category_id)
transaction.commit()
self.tic() self.tic()
person_list = [ person_list = [
...@@ -1203,7 +1198,6 @@ class TestWorkflow(SecurityTestCase): ...@@ -1203,7 +1198,6 @@ class TestWorkflow(SecurityTestCase):
assignment_document = person_document.newContent(portal_type='Assignment') assignment_document = person_document.newContent(portal_type='Assignment')
assignment_document.edit(function=assignment['function']) assignment_document.edit(function=assignment['function'])
self.portal.portal_workflow.doActionFor(assignment_document, 'open_action') self.portal.portal_workflow.doActionFor(assignment_document, 'open_action')
transaction.commit()
self.tic() self.tic()
setattr(self, person['id'], person_document) setattr(self, person['id'], person_document)
......
This diff is collapsed.
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
import unittest import unittest
import os import os
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
...@@ -247,7 +246,7 @@ class TestMovement(ERP5TypeTestCase): ...@@ -247,7 +246,7 @@ class TestMovement(ERP5TypeTestCase):
self.portal.newContent(id="dummy_delivery_module", self.portal.newContent(id="dummy_delivery_module",
portal_type="My Delivery Module") portal_type="My Delivery Module")
transaction.commit() self.commit()
self.delivery_module = self.portal.dummy_delivery_module self.delivery_module = self.portal.dummy_delivery_module
def getPortalName(self): def getPortalName(self):
...@@ -540,7 +539,7 @@ class TestAccountingTransactionLine(TestMovement): ...@@ -540,7 +539,7 @@ class TestAccountingTransactionLine(TestMovement):
self.portal.newContent(id="accounting_transaction_line_module", self.portal.newContent(id="accounting_transaction_line_module",
portal_type="My Accounting Transaction Line Module") portal_type="My Accounting Transaction Line Module")
transaction.commit() self.commit()
self.atl_module = self.portal.accounting_transaction_line_module self.atl_module = self.portal.accounting_transaction_line_module
def _makeOne(self, **kw): def _makeOne(self, **kw):
......
...@@ -29,7 +29,6 @@ import unittest ...@@ -29,7 +29,6 @@ import unittest
from Products.ERP5Type.tests.utils import reindex from Products.ERP5Type.tests.utils import reindex
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from zLOG import LOG from zLOG import LOG
import transaction
class TestApparelModel(ERP5TypeTestCase): class TestApparelModel(ERP5TypeTestCase):
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
# #
import transaction
import os, sys import os, sys
if __name__ == '__main__': if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py')) execfile(os.path.join(sys.path[0], 'framework.py'))
...@@ -112,7 +111,6 @@ class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase): ...@@ -112,7 +111,6 @@ class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase):
variations = [variation1, variation2] variations = [variation1, variation2]
# Commit and catalog # Commit and catalog
transaction.commit()
self.tic() self.tic()
component.setVariationBaseCategoryList(['variation']) component.setVariationBaseCategoryList(['variation'])
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
import unittest import unittest
import time import time
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.backportUnittest import expectedFailure from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.Formulator.Errors import ValidationError from Products.Formulator.Errors import ValidationError
...@@ -169,7 +168,7 @@ class TestAuthenticationPolicy(ERP5TypeTestCase): ...@@ -169,7 +168,7 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
person.notifyLoginFailure() person.notifyLoginFailure()
person.notifyLoginFailure() person.notifyLoginFailure()
transaction.commit() self.commit()
self.assertTrue(person.isLoginBlocked()) self.assertTrue(person.isLoginBlocked())
self.stepTic() self.stepTic()
self.assertTrue(person.isLoginBlocked()) self.assertTrue(person.isLoginBlocked())
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
import unittest import unittest
import time import time
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.backportUnittest import expectedFailure from Products.ERP5Type.tests.backportUnittest import expectedFailure
from DateTime import DateTime from DateTime import DateTime
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
############################################################################## ##############################################################################
import unittest import unittest
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from DateTime import DateTime from DateTime import DateTime
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
import unittest import unittest
import os import os
import transaction
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase,\ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase,\
...@@ -193,7 +192,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -193,7 +192,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
Check if there is a activity in activity queue. Check if there is a activity in activity queue.
""" """
portal = self.getPortal() portal = self.getPortal()
transaction.commit() self.commit()
message_list = portal.portal_activities.getMessageList() message_list = portal.portal_activities.getMessageList()
method_id_list = [x.method_id for x in message_list] method_id_list = [x.method_id for x in message_list]
# XXX FIXME: how many activities should be created normally ? # XXX FIXME: how many activities should be created normally ?
...@@ -949,7 +948,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -949,7 +948,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
dummy_worlflow_id = 'never_existent_workflow' dummy_worlflow_id = 'never_existent_workflow'
addWorkflowByType(pw, 'erp5_workflow', dummy_worlflow_id) addWorkflowByType(pw, 'erp5_workflow', dummy_worlflow_id)
transaction.commit() self.commit()
cbt = pw._chains_by_type cbt = pw._chains_by_type
props = {} props = {}
...@@ -960,7 +959,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -960,7 +959,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
pw.manage_changeWorkflows('', props = props) pw.manage_changeWorkflows('', props = props)
pw.manage_delObjects([dummy_worlflow_id]) pw.manage_delObjects([dummy_worlflow_id])
transaction.commit() self.commit()
try: try:
self.assertRaises(AttributeError, getattr, obj, self.assertRaises(AttributeError, getattr, obj,
...@@ -977,7 +976,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -977,7 +976,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
props['chain_%s' % id] = ','.join(wf_ids) props['chain_%s' % id] = ','.join(wf_ids)
pw.manage_changeWorkflows('', props = props) pw.manage_changeWorkflows('', props = props)
transaction.commit() self.commit()
def test_14_UpdateRoleMappingwithNoDefinedRoleAndAcquisitionActivatedOnWorkflow(self, quiet=quiet, run=run_all_test): def test_14_UpdateRoleMappingwithNoDefinedRoleAndAcquisitionActivatedOnWorkflow(self, quiet=quiet, run=run_all_test):
"""updateRoleMappingsFor does a logical AND between all workflow defining security, """updateRoleMappingsFor does a logical AND between all workflow defining security,
...@@ -1173,7 +1172,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -1173,7 +1172,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
'return context.getDummyTypeBaseMethod()' ) 'return context.getDummyTypeBaseMethod()' )
transaction.commit() # Flush transactional cache. self.commit()# Flush transactional cache.
self.assertEqual(pers.getDummyTypeBaseMethod(), pers.getId()) self.assertEqual(pers.getDummyTypeBaseMethod(), pers.getId())
# Call once more to check cache. # Call once more to check cache.
self.assertEqual(pers.getDummyTypeBaseMethod(), pers.getId()) self.assertEqual(pers.getDummyTypeBaseMethod(), pers.getId())
...@@ -1187,7 +1186,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -1187,7 +1186,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
""" """
self.getPortal().person_module.newContent(portal_type='Person', self.getPortal().person_module.newContent(portal_type='Person',
title='translate_table_test') title='translate_table_test')
transaction.commit()
self.tic() self.tic()
self.assertEquals(1, len(self.getPortal().portal_catalog( self.assertEquals(1, len(self.getPortal().portal_catalog(
portal_type='Person', title='translate_table_test'))) portal_type='Person', title='translate_table_test')))
...@@ -1244,7 +1242,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -1244,7 +1242,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
""" """
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
person.isIndexable = 0 person.isIndexable = 0
transaction.commit()
self.tic() self.tic()
self.assertFalse(person.isIndexable) self.assertFalse(person.isIndexable)
self.assertEquals(0, len(self.portal.portal_catalog(uid=person.getUid()))) self.assertEquals(0, len(self.portal.portal_catalog(uid=person.getUid())))
...@@ -1255,7 +1252,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -1255,7 +1252,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
"""check if a document is not indexed where we call edit() and set isIndexable=0 after it is already indexed. """check if a document is not indexed where we call edit() and set isIndexable=0 after it is already indexed.
""" """
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
transaction.commit()
self.tic() self.tic()
self.assertTrue(person.isIndexable) self.assertTrue(person.isIndexable)
self.assertEquals(1, len(self.portal.portal_catalog(uid=person.getUid()))) self.assertEquals(1, len(self.portal.portal_catalog(uid=person.getUid())))
...@@ -1264,7 +1260,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -1264,7 +1260,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
# not yet False when edit() is called. # not yet False when edit() is called.
person.edit() person.edit()
person.isIndexable = 0 person.isIndexable = 0
transaction.commit()
self.tic() self.tic()
self.assertFalse(person.isIndexable) self.assertFalse(person.isIndexable)
self.assertEquals(0, len(self.portal.portal_catalog(uid=person.getUid()))) self.assertEquals(0, len(self.portal.portal_catalog(uid=person.getUid())))
...@@ -1275,7 +1270,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -1275,7 +1270,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
"""check if a document is not indexed where we set isIndexable=0 and call edit() after it is already indexed. """check if a document is not indexed where we set isIndexable=0 and call edit() after it is already indexed.
""" """
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
transaction.commit()
self.tic() self.tic()
self.assertTrue(person.isIndexable) self.assertTrue(person.isIndexable)
self.assertEquals(1, len(self.portal.portal_catalog(uid=person.getUid()))) self.assertEquals(1, len(self.portal.portal_catalog(uid=person.getUid())))
...@@ -1284,7 +1278,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -1284,7 +1278,6 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
# is already False when edit() is called. # is already False when edit() is called.
person.isIndexable = 0 person.isIndexable = 0
person.edit() person.edit()
transaction.commit()
self.tic() self.tic()
self.assertFalse(person.isIndexable) self.assertFalse(person.isIndexable)
self.assertEquals(0, len(self.portal.portal_catalog(uid=person.getUid()))) self.assertEquals(0, len(self.portal.portal_catalog(uid=person.getUid())))
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
import unittest import unittest
import transaction
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
...@@ -50,10 +49,9 @@ class TestBudget(ERP5TypeTestCase): ...@@ -50,10 +49,9 @@ class TestBudget(ERP5TypeTestCase):
category.newContent(portal_type='Category', id='2.2') category.newContent(portal_type='Category', id='2.2')
def beforeTearDown(self): def beforeTearDown(self):
transaction.abort() self.abort()
self.portal.accounting_module.manage_delObjects( self.portal.accounting_module.manage_delObjects(
list(self.portal.accounting_module.objectIds())) list(self.portal.accounting_module.objectIds()))
transaction.commit()
self.tic() self.tic()
def getBusinessTemplateList(self): def getBusinessTemplateList(self):
...@@ -416,7 +414,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -416,7 +414,6 @@ class TestBudget(ERP5TypeTestCase):
atransaction.confirm() atransaction.confirm()
# a confirmed transaction engages budget # a confirmed transaction engages budget
transaction.commit()
self.tic() self.tic()
self.assertEquals(dict(), budget_line.getConsumedBudgetDict()) self.assertEquals(dict(), budget_line.getConsumedBudgetDict())
...@@ -433,7 +430,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -433,7 +430,6 @@ class TestBudget(ERP5TypeTestCase):
atransaction.stop() atransaction.stop()
# a stopped transaction consumes budget # a stopped transaction consumes budget
transaction.commit()
self.tic() self.tic()
self.assertEquals( self.assertEquals(
...@@ -556,7 +552,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -556,7 +552,6 @@ class TestBudget(ERP5TypeTestCase):
source_credit=100) source_credit=100)
atransaction.stop() atransaction.stop()
transaction.commit()
self.tic() self.tic()
self.assertEquals( self.assertEquals(
...@@ -670,7 +665,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -670,7 +665,6 @@ class TestBudget(ERP5TypeTestCase):
source_credit=300) source_credit=300)
atransaction.stop() atransaction.stop()
transaction.commit()
self.tic() self.tic()
self.assertEquals( self.assertEquals(
...@@ -779,7 +773,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -779,7 +773,6 @@ class TestBudget(ERP5TypeTestCase):
source_credit=300) source_credit=300)
atransaction.stop() atransaction.stop()
transaction.commit()
self.tic() self.tic()
self.assertEquals( self.assertEquals(
...@@ -884,7 +877,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -884,7 +877,6 @@ class TestBudget(ERP5TypeTestCase):
source_credit=120) source_credit=120)
atransaction.stop() atransaction.stop()
transaction.commit()
self.tic() self.tic()
self.assertEquals( self.assertEquals(
...@@ -1018,7 +1010,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -1018,7 +1010,6 @@ class TestBudget(ERP5TypeTestCase):
source_credit=100) source_credit=100)
atransaction.stop() atransaction.stop()
transaction.commit()
self.tic() self.tic()
self.assertEquals( self.assertEquals(
...@@ -1128,7 +1119,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -1128,7 +1119,6 @@ class TestBudget(ERP5TypeTestCase):
source_credit=100) source_credit=100)
atransaction.stop() atransaction.stop()
transaction.commit()
self.tic() self.tic()
self.assertEquals( self.assertEquals(
...@@ -1217,7 +1207,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -1217,7 +1207,6 @@ class TestBudget(ERP5TypeTestCase):
source_credit=100) source_credit=100)
atransaction.stop() atransaction.stop()
transaction.commit()
self.tic() self.tic()
self.assertEquals( self.assertEquals(
...@@ -1304,7 +1293,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -1304,7 +1293,6 @@ class TestBudget(ERP5TypeTestCase):
source_credit=100) source_credit=100)
atransaction.stop() atransaction.stop()
transaction.commit()
self.tic() self.tic()
self.assertEquals( self.assertEquals(
...@@ -1463,7 +1451,6 @@ class TestBudget(ERP5TypeTestCase): ...@@ -1463,7 +1451,6 @@ class TestBudget(ERP5TypeTestCase):
source_debit=100) source_debit=100)
atransaction.stop() atransaction.stop()
transaction.commit()
self.tic() self.tic()
# Budget_getBudgetConsumptionReportData returns all the data for the report # Budget_getBudgetConsumptionReportData returns all the data for the report
...@@ -1876,7 +1863,7 @@ class TestBudget(ERP5TypeTestCase): ...@@ -1876,7 +1863,7 @@ class TestBudget(ERP5TypeTestCase):
self.portal.product_module.newContent(portal_type='Product', self.portal.product_module.newContent(portal_type='Product',
id='demo_product', id='demo_product',
title='Demo Prduct') title='Demo Prduct')
transaction.commit() self.commit()
budget_model = self.portal.budget_model_module.newContent( budget_model = self.portal.budget_model_module.newContent(
portal_type='Budget Model') portal_type='Budget Model')
budget_model.newContent( budget_model.newContent(
...@@ -1938,7 +1925,7 @@ class TestBudget(ERP5TypeTestCase): ...@@ -1938,7 +1925,7 @@ class TestBudget(ERP5TypeTestCase):
spll.setQuantity(quantity) spll.setQuantity(quantity)
spll.setPrice(price) spll.setPrice(price)
spll.setResource('product_module/%s' % product_id) spll.setResource('product_module/%s' % product_id)
transaction.commit() self.commit()
spl.confirm() spl.confirm()
self.tic() self.tic()
spl.start() spl.start()
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
import unittest import unittest
import transaction
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
...@@ -125,7 +124,6 @@ class TestBug(ERP5TypeTestCase): ...@@ -125,7 +124,6 @@ class TestBug(ERP5TypeTestCase):
start_date='1980-01-01', start_date='1980-01-01',
stop_date='2099-12-31') stop_date='2099-12-31')
assignment.open() assignment.open()
transaction.commit()
self.tic() self.tic()
portal_type_list = [] portal_type_list = []
for portal_type in (self.project_portal_type, for portal_type in (self.project_portal_type,
...@@ -148,7 +146,6 @@ class TestBug(ERP5TypeTestCase): ...@@ -148,7 +146,6 @@ class TestBug(ERP5TypeTestCase):
role_category='group/dummy') role_category='group/dummy')
ti.updateRoleMapping() ti.updateRoleMapping()
transaction.commit()
self.tic() self.tic()
portal.portal_caches.clearAllCache() portal.portal_caches.clearAllCache()
...@@ -596,10 +593,8 @@ class TestBug(ERP5TypeTestCase): ...@@ -596,10 +593,8 @@ class TestBug(ERP5TypeTestCase):
cloned_bug_line = bug_line.Base_createCloneDocument(batch_mode=1) cloned_bug_line = bug_line.Base_createCloneDocument(batch_mode=1)
self.workflow_tool.doActionFor(bug, 'confirm_action', send_event=1) self.workflow_tool.doActionFor(bug, 'confirm_action', send_event=1)
self.assertEquals(bug.getSimulationState(), 'confirmed') self.assertEquals(bug.getSimulationState(), 'confirmed')
transaction.commit()
self.tic() self.tic()
bug.deleteContent(id='2') bug.deleteContent(id='2')
transaction.commit()
self.tic() self.tic()
self.workflow_tool.doActionFor(bug, 'stop_action', send_event=1) self.workflow_tool.doActionFor(bug, 'stop_action', send_event=1)
self.assertEquals(bug.getSimulationState(), 'stopped') self.assertEquals(bug.getSimulationState(), 'stopped')
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
import unittest import unittest
import logging import logging
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Acquisition import aq_base from Acquisition import aq_base
...@@ -104,7 +103,7 @@ class BusinessTemplateMixin(TestDeveloperMixin, ERP5TypeTestCase, LogInterceptor ...@@ -104,7 +103,7 @@ class BusinessTemplateMixin(TestDeveloperMixin, ERP5TypeTestCase, LogInterceptor
if (content_type_registry is not None and if (content_type_registry is not None and
'any' in content_type_registry.predicate_ids): 'any' in content_type_registry.predicate_ids):
content_type_registry.removePredicate('any') content_type_registry.removePredicate('any')
transaction.commit() self.commit()
def beforeTearDown(self): def beforeTearDown(self):
"""Remove objects created in tests.""" """Remove objects created in tests."""
...@@ -182,7 +181,7 @@ class BusinessTemplateMixin(TestDeveloperMixin, ERP5TypeTestCase, LogInterceptor ...@@ -182,7 +181,7 @@ class BusinessTemplateMixin(TestDeveloperMixin, ERP5TypeTestCase, LogInterceptor
for property_sheet in ('UnitTest',): for property_sheet in ('UnitTest',):
if property_sheet in property_sheet_tool.objectIds(): if property_sheet in property_sheet_tool.objectIds():
property_sheet_tool.manage_delObjects([property_sheet]) property_sheet_tool.manage_delObjects([property_sheet])
transaction.commit() self.commit()
self._ignore_log_errors() self._ignore_log_errors()
def getBusinessTemplate(self,title): def getBusinessTemplate(self,title):
...@@ -6177,7 +6176,6 @@ class TestBusinessTemplate(BusinessTemplateMixin): ...@@ -6177,7 +6176,6 @@ class TestBusinessTemplate(BusinessTemplateMixin):
# create a previously existing instance of the overriden document type # create a previously existing instance of the overriden document type
File = portal.portal_types.getPortalTypeClass('File') File = portal.portal_types.getPortalTypeClass('File')
portal._setObject('another_file', File('another_file')) portal._setObject('another_file', File('another_file'))
transaction.commit()
self.tic() self.tic()
# logged errors could keep a reference to a traceback having a reference # logged errors could keep a reference to a traceback having a reference
# to 'another_file' object # to 'another_file' object
...@@ -6190,14 +6188,12 @@ class TestBusinessTemplate(BusinessTemplateMixin): ...@@ -6190,14 +6188,12 @@ class TestBusinessTemplate(BusinessTemplateMixin):
bt = template_tool.download(bt_path) bt = template_tool.download(bt_path)
assert marker_list assert marker_list
if i: if i:
transaction.commit()
self.tic() self.tic()
bt.install(force=1) bt.install(force=1)
assert not marker_list assert not marker_list
gc.enable() gc.enable()
for id in object_id_list: for id in object_id_list:
self.assertEqual(getattr(portal, id).int_index, i) self.assertEqual(getattr(portal, id).int_index, i)
transaction.commit()
self.tic() self.tic()
finally: finally:
BaseTemplateItem.removeProperties = BaseTemplateItem_removeProperties BaseTemplateItem.removeProperties = BaseTemplateItem_removeProperties
...@@ -7145,7 +7141,7 @@ class TestDocumentTemplateItem(BusinessTemplateMixin): ...@@ -7145,7 +7141,7 @@ class TestDocumentTemplateItem(BusinessTemplateMixin):
copied, = template_tool.manage_pasteObjects(cb_data) copied, = template_tool.manage_pasteObjects(cb_data)
copied_bt = template_tool._getOb(copied['new_id']) copied_bt = template_tool._getOb(copied['new_id'])
getattr(copied_bt, self.set_template_id_method_name)(sequence['document_id']) getattr(copied_bt, self.set_template_id_method_name)(sequence['document_id'])
transaction.commit() self.commit()
sequence.edit(current_bt=copied_bt) sequence.edit(current_bt=copied_bt)
importFromFilesystem = DocumentComponent.importFromFilesystem importFromFilesystem = DocumentComponent.importFromFilesystem
......
This diff is collapsed.
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
# #
############################################################################## ##############################################################################
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
...@@ -97,15 +96,14 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -97,15 +96,14 @@ class TestCalendar(ERP5ReportTestCase):
self._addPropertySheet('Group Presence Period', 'CalendarPeriodConstraint') self._addPropertySheet('Group Presence Period', 'CalendarPeriodConstraint')
# regenerate accessors after category changes & portal type changes # regenerate accessors after category changes & portal type changes
transaction.commit() self.commit()
def beforeTearDown(self): def beforeTearDown(self):
transaction.abort() self.abort()
for module in (self.portal.group_calendar_module, for module in (self.portal.group_calendar_module,
self.portal.leave_request_module, self.portal.leave_request_module,
self.portal.presence_request_module,): self.portal.presence_request_module,):
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
transaction.commit()
self.tic() self.tic()
def stepCreatePerson(self, sequence=None, sequence_list=None, **kw): def stepCreatePerson(self, sequence=None, sequence_list=None, **kw):
...@@ -814,7 +812,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -814,7 +812,6 @@ class TestCalendar(ERP5ReportTestCase):
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
calendar_value=group_calendar) calendar_value=group_calendar)
transaction.commit()
self.tic() self.tic()
# there is 43200 seconds between self.start_date and self.stop_date # there is 43200 seconds between self.start_date and self.stop_date
...@@ -849,7 +846,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -849,7 +846,6 @@ class TestCalendar(ERP5ReportTestCase):
leave_request.setDestinationValue(person) leave_request.setDestinationValue(person)
leave_request.confirm() leave_request.confirm()
transaction.commit()
self.tic() self.tic()
self.assertEquals(0, person.getAvailableTime( self.assertEquals(0, person.getAvailableTime(
...@@ -888,7 +884,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -888,7 +884,6 @@ class TestCalendar(ERP5ReportTestCase):
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
calendar_value=group_calendar) calendar_value=group_calendar)
transaction.commit()
self.tic() self.tic()
self.assertEquals((18 - 14 + 12 - 8) * 60 * 60, person.getAvailableTime( self.assertEquals((18 - 14 + 12 - 8) * 60 * 60, person.getAvailableTime(
...@@ -922,7 +917,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -922,7 +917,6 @@ class TestCalendar(ERP5ReportTestCase):
leave_request.setDestinationValue(person) leave_request.setDestinationValue(person)
leave_request.confirm() leave_request.confirm()
transaction.commit()
self.tic() self.tic()
self.assertEquals(0, person.getAvailableTime( self.assertEquals(0, person.getAvailableTime(
...@@ -959,7 +953,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -959,7 +953,6 @@ class TestCalendar(ERP5ReportTestCase):
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
calendar_value=group_calendar) calendar_value=group_calendar)
transaction.commit()
self.tic() self.tic()
# 2008/01/07 was a Monday # 2008/01/07 was a Monday
...@@ -994,7 +987,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -994,7 +987,6 @@ class TestCalendar(ERP5ReportTestCase):
leave_request.setDestinationValue(person) leave_request.setDestinationValue(person)
leave_request.confirm() leave_request.confirm()
transaction.commit()
self.tic() self.tic()
self.assertEquals(0, person.getAvailableTime( self.assertEquals(0, person.getAvailableTime(
...@@ -1025,7 +1017,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1025,7 +1017,6 @@ class TestCalendar(ERP5ReportTestCase):
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
calendar_value=group_calendar) calendar_value=group_calendar)
transaction.commit()
self.tic() self.tic()
self.assertEquals((18 - 8) * 60 * 60, person.getAvailableTime( self.assertEquals((18 - 8) * 60 * 60, person.getAvailableTime(
...@@ -1058,7 +1049,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1058,7 +1049,6 @@ class TestCalendar(ERP5ReportTestCase):
leave_request.setDestinationValue(person) leave_request.setDestinationValue(person)
leave_request.confirm() leave_request.confirm()
transaction.commit()
self.tic() self.tic()
self.assertEquals((9-8 + 18-17) * 60 * 60, person.getAvailableTime( self.assertEquals((9-8 + 18-17) * 60 * 60, person.getAvailableTime(
...@@ -1097,7 +1087,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1097,7 +1087,6 @@ class TestCalendar(ERP5ReportTestCase):
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
calendar_value=group_calendar) calendar_value=group_calendar)
transaction.commit()
self.tic() self.tic()
leave_request = self.portal.leave_request_module.newContent( leave_request = self.portal.leave_request_module.newContent(
portal_type='Leave Request') portal_type='Leave Request')
...@@ -1110,7 +1099,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1110,7 +1099,6 @@ class TestCalendar(ERP5ReportTestCase):
leave_request.setDestinationValue(person) leave_request.setDestinationValue(person)
leave_request.confirm() leave_request.confirm()
transaction.commit()
self.tic() self.tic()
self.assertEquals((18-9) * 60 * 60, person.getAvailableTime( self.assertEquals((18-9) * 60 * 60, person.getAvailableTime(
...@@ -1146,7 +1134,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1146,7 +1134,6 @@ class TestCalendar(ERP5ReportTestCase):
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
calendar_value=group_calendar) calendar_value=group_calendar)
transaction.commit()
self.tic() self.tic()
leave_request = self.portal.leave_request_module.newContent( leave_request = self.portal.leave_request_module.newContent(
portal_type='Leave Request') portal_type='Leave Request')
...@@ -1159,7 +1146,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1159,7 +1146,6 @@ class TestCalendar(ERP5ReportTestCase):
leave_request.setDestinationValue(person) leave_request.setDestinationValue(person)
leave_request.confirm() leave_request.confirm()
transaction.commit()
self.tic() self.tic()
self.assertEquals((17-8) * 60 * 60, person.getAvailableTime( self.assertEquals((17-8) * 60 * 60, person.getAvailableTime(
...@@ -1195,7 +1181,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1195,7 +1181,6 @@ class TestCalendar(ERP5ReportTestCase):
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
calendar_value=group_calendar) calendar_value=group_calendar)
transaction.commit()
self.tic() self.tic()
leave_request = self.portal.leave_request_module.newContent( leave_request = self.portal.leave_request_module.newContent(
portal_type='Leave Request') portal_type='Leave Request')
...@@ -1214,7 +1199,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1214,7 +1199,6 @@ class TestCalendar(ERP5ReportTestCase):
leave_request.setDestinationValue(person) leave_request.setDestinationValue(person)
leave_request.confirm() leave_request.confirm()
transaction.commit()
self.tic() self.tic()
self.assertEquals((18-13 + 12-10 + 9-8) * 60 * 60, person.getAvailableTime( self.assertEquals((18-13 + 12-10 + 9-8) * 60 * 60, person.getAvailableTime(
...@@ -1254,7 +1238,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1254,7 +1238,6 @@ class TestCalendar(ERP5ReportTestCase):
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
calendar_value=group_calendar) calendar_value=group_calendar)
transaction.commit()
self.tic() self.tic()
leave_request = self.portal.leave_request_module.newContent( leave_request = self.portal.leave_request_module.newContent(
portal_type='Leave Request') portal_type='Leave Request')
...@@ -1273,7 +1256,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1273,7 +1256,6 @@ class TestCalendar(ERP5ReportTestCase):
leave_request.setDestinationValue(person) leave_request.setDestinationValue(person)
leave_request.confirm() leave_request.confirm()
transaction.commit()
self.tic() self.tic()
self.assertEquals((18-11 + 9-8) * 60 * 60, person.getAvailableTime( self.assertEquals((18-11 + 9-8) * 60 * 60, person.getAvailableTime(
...@@ -1311,7 +1293,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1311,7 +1293,6 @@ class TestCalendar(ERP5ReportTestCase):
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
calendar_value=group_calendar) calendar_value=group_calendar)
transaction.commit()
self.tic() self.tic()
leave_request = self.portal.leave_request_module.newContent( leave_request = self.portal.leave_request_module.newContent(
portal_type='Leave Request') portal_type='Leave Request')
...@@ -1330,7 +1311,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1330,7 +1311,6 @@ class TestCalendar(ERP5ReportTestCase):
leave_request.setDestinationValue(person) leave_request.setDestinationValue(person)
leave_request.confirm() leave_request.confirm()
transaction.commit()
self.tic() self.tic()
self.assertEquals((18-11 + 9-8) * 60 * 60, person.getAvailableTime( self.assertEquals((18-11 + 9-8) * 60 * 60, person.getAvailableTime(
...@@ -1414,7 +1394,6 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -1414,7 +1394,6 @@ class TestCalendar(ERP5ReportTestCase):
self.portal.portal_categories.calendar_period_type.type3) self.portal.portal_categories.calendar_period_type.type3)
leave_request2.confirm() leave_request2.confirm()
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
############################################################################## ##############################################################################
import unittest import unittest
import transaction
from Products.ERP5.tests.testTradeModelLine import TestTradeModelLineMixin from Products.ERP5.tests.testTradeModelLine import TestTradeModelLineMixin
...@@ -196,7 +195,7 @@ return getBaseAmountQuantity""") ...@@ -196,7 +195,7 @@ return getBaseAmountQuantity""")
)) ))
self.appendBaseContributionCategory(order['1'], special_discount) self.appendBaseContributionCategory(order['1'], special_discount)
self.appendBaseContributionCategory(order['2'], special_discount) self.appendBaseContributionCategory(order['2'], special_discount)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD_LINEAR=dict(total_price=0), SPECIAL_DISCOUNT_3CD_LINEAR=dict(total_price=0),
TOTAL_PRICE_WITHOUT_VAT=dict(total_price=8100), TOTAL_PRICE_WITHOUT_VAT=dict(total_price=8100),
...@@ -209,7 +208,7 @@ return getBaseAmountQuantity""") ...@@ -209,7 +208,7 @@ return getBaseAmountQuantity""")
quantity=1, quantity=1,
price=2400) price=2400)
self.appendBaseContributionCategory(line, special_discount) self.appendBaseContributionCategory(line, special_discount)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD_LINEAR=dict(total_price=-1040), SPECIAL_DISCOUNT_3CD_LINEAR=dict(total_price=-1040),
TOTAL_PRICE_WITHOUT_VAT=dict(total_price=9460), TOTAL_PRICE_WITHOUT_VAT=dict(total_price=9460),
...@@ -252,7 +251,7 @@ return lambda delivery_amount, base_application, **kw: \\ ...@@ -252,7 +251,7 @@ return lambda delivery_amount, base_application, **kw: \\
)) ))
self.appendBaseContributionCategory(order['1'], special_discount) self.appendBaseContributionCategory(order['1'], special_discount)
self.appendBaseContributionCategory(order['2'], special_discount) self.appendBaseContributionCategory(order['2'], special_discount)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD_FIXED=dict(total_price=0), SPECIAL_DISCOUNT_3CD_FIXED=dict(total_price=0),
TOTAL_PRICE_WITHOUT_VAT=dict(total_price=11000), TOTAL_PRICE_WITHOUT_VAT=dict(total_price=11000),
...@@ -265,7 +264,7 @@ return lambda delivery_amount, base_application, **kw: \\ ...@@ -265,7 +264,7 @@ return lambda delivery_amount, base_application, **kw: \\
quantity=1, quantity=1,
price=2400) price=2400)
self.appendBaseContributionCategory(line, special_discount) self.appendBaseContributionCategory(line, special_discount)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD_FIXED=dict(total_price=-500), SPECIAL_DISCOUNT_3CD_FIXED=dict(total_price=-500),
TOTAL_PRICE_WITHOUT_VAT=dict(total_price=12900), TOTAL_PRICE_WITHOUT_VAT=dict(total_price=12900),
...@@ -312,7 +311,7 @@ return getBaseAmountQuantity""") ...@@ -312,7 +311,7 @@ return getBaseAmountQuantity""")
)) ))
self.appendBaseContributionCategory(order['1'], special_discount) self.appendBaseContributionCategory(order['1'], special_discount)
self.appendBaseContributionCategory(order['3'], special_discount) self.appendBaseContributionCategory(order['3'], special_discount)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD_LINEAR=dict(total_price=0), SPECIAL_DISCOUNT_3CD_LINEAR=dict(total_price=0),
TOTAL_PRICE_WITHOUT_VAT=dict(total_price=11000), TOTAL_PRICE_WITHOUT_VAT=dict(total_price=11000),
...@@ -325,7 +324,7 @@ return getBaseAmountQuantity""") ...@@ -325,7 +324,7 @@ return getBaseAmountQuantity""")
quantity=1, quantity=1,
price=2400) price=2400)
self.appendBaseContributionCategory(line, special_discount) self.appendBaseContributionCategory(line, special_discount)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD_LINEAR=dict(total_price=-1340), SPECIAL_DISCOUNT_3CD_LINEAR=dict(total_price=-1340),
TOTAL_PRICE_WITHOUT_VAT=dict(total_price=12060), TOTAL_PRICE_WITHOUT_VAT=dict(total_price=12060),
...@@ -372,7 +371,7 @@ return lambda delivery_amount, base_application, **kw: \\ ...@@ -372,7 +371,7 @@ return lambda delivery_amount, base_application, **kw: \\
dict(id='1', price=3000, quantity=2, resource_value=self.music_album_4), dict(id='1', price=3000, quantity=2, resource_value=self.music_album_4),
)) ))
self.appendBaseContributionCategory(order['1'], poster_present_3cd) self.appendBaseContributionCategory(order['1'], poster_present_3cd)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD_OR_1DVD_FIXED=dict(total_price=None), SPECIAL_DISCOUNT_3CD_OR_1DVD_FIXED=dict(total_price=None),
TOTAL_PRICE_WITHOUT_VAT=dict(total_price=6000), TOTAL_PRICE_WITHOUT_VAT=dict(total_price=6000),
...@@ -385,7 +384,7 @@ return lambda delivery_amount, base_application, **kw: \\ ...@@ -385,7 +384,7 @@ return lambda delivery_amount, base_application, **kw: \\
quantity=1, quantity=1,
price=3000) price=3000)
self.appendBaseContributionCategory(line, poster_present_1dvd) self.appendBaseContributionCategory(line, poster_present_1dvd)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD_OR_1DVD_FIXED=dict(total_price=None, quantity=1, SPECIAL_DISCOUNT_3CD_OR_1DVD_FIXED=dict(total_price=None, quantity=1,
resource_value=self.poster), resource_value=self.poster),
...@@ -399,7 +398,7 @@ return lambda delivery_amount, base_application, **kw: \\ ...@@ -399,7 +398,7 @@ return lambda delivery_amount, base_application, **kw: \\
quantity=1, quantity=1,
price=2400) price=2400)
self.appendBaseContributionCategory(line, poster_present_3cd) self.appendBaseContributionCategory(line, poster_present_3cd)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD_OR_1DVD_FIXED=dict(total_price=None, quantity=1, SPECIAL_DISCOUNT_3CD_OR_1DVD_FIXED=dict(total_price=None, quantity=1,
resource_value=self.poster), resource_value=self.poster),
...@@ -448,7 +447,7 @@ return getBaseAmountQuantity""") ...@@ -448,7 +447,7 @@ return getBaseAmountQuantity""")
)) ))
self.appendBaseContributionCategory(order['3'], special_discount) self.appendBaseContributionCategory(order['3'], special_discount)
self.appendBaseContributionCategory(order['4'], special_discount) self.appendBaseContributionCategory(order['4'], special_discount)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD=dict(total_price=0), SPECIAL_DISCOUNT_3CD=dict(total_price=0),
TOTAL_PRICE_WITHOUT_VAT=dict(total_price=12000), TOTAL_PRICE_WITHOUT_VAT=dict(total_price=12000),
...@@ -457,7 +456,7 @@ return getBaseAmountQuantity""") ...@@ -457,7 +456,7 @@ return getBaseAmountQuantity""")
# add one more cd, then total is 3. the special discount will be applied. # add one more cd, then total is 3. the special discount will be applied.
order['3'].setQuantity(2) order['3'].setQuantity(2)
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
SPECIAL_DISCOUNT_3CD=dict(total_price=-450), SPECIAL_DISCOUNT_3CD=dict(total_price=-450),
TOTAL_PRICE_WITHOUT_VAT=dict(total_price=16550), TOTAL_PRICE_WITHOUT_VAT=dict(total_price=16550),
...@@ -488,7 +487,7 @@ return lambda *args, **kw: 1""") ...@@ -488,7 +487,7 @@ return lambda *args, **kw: 1""")
dict(id='1', price=3000, quantity=1, resource_value=self.movie_dvd_1), dict(id='1', price=3000, quantity=1, resource_value=self.movie_dvd_1),
dict(id='2', price=1000, quantity=1, resource_value=self.movie_dvd_2), dict(id='2', price=1000, quantity=1, resource_value=self.movie_dvd_2),
)) ))
transaction.commit() self.commit()
self.getAggregatedAmountDict(order, partial_check=True, self.getAggregatedAmountDict(order, partial_check=True,
TOTAL_PRICE_WITHOUT_VAT=dict(total_price=4500), TOTAL_PRICE_WITHOUT_VAT=dict(total_price=4500),
TOTAL_PRICE_WITH_VAT=dict(total_price=4725), TOTAL_PRICE_WITH_VAT=dict(total_price=4725),
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
import unittest import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import to_utf8 from Products.ERP5Type.tests.utils import to_utf8
import transaction
class TestContentTranslation(ERP5TypeTestCase): class TestContentTranslation(ERP5TypeTestCase):
...@@ -61,7 +60,6 @@ class TestContentTranslation(ERP5TypeTestCase): ...@@ -61,7 +60,6 @@ class TestContentTranslation(ERP5TypeTestCase):
portal.Localizer._add_user_defined_language('Nobody Readable', 'nob-read') portal.Localizer._add_user_defined_language('Nobody Readable', 'nob-read')
portal.Localizer.add_language('nob-read') portal.Localizer.add_language('nob-read')
transaction.commit()
self.tic() self.tic()
person1 = portal.person_module.newContent(portal_type='Person', person1 = portal.person_module.newContent(portal_type='Person',
...@@ -85,7 +83,6 @@ class TestContentTranslation(ERP5TypeTestCase): ...@@ -85,7 +83,6 @@ class TestContentTranslation(ERP5TypeTestCase):
self.assertEqual(person2.getNobReadTranslatedLastName(' '), ' ') self.assertEqual(person2.getNobReadTranslatedLastName(' '), ' ')
self.assertEqual(person3.getNobReadTranslatedFirstName('友介'), '友介') self.assertEqual(person3.getNobReadTranslatedFirstName('友介'), '友介')
self.assertEqual(person3.getNobReadTranslatedLastName('村岡'), '村岡') self.assertEqual(person3.getNobReadTranslatedLastName('村岡'), '村岡')
transaction.commit()
self.tic() self.tic()
result1 = portal.portal_catalog(content_translation_title='Yusuke') result1 = portal.portal_catalog(content_translation_title='Yusuke')
...@@ -100,7 +97,6 @@ class TestContentTranslation(ERP5TypeTestCase): ...@@ -100,7 +97,6 @@ class TestContentTranslation(ERP5TypeTestCase):
# re-catalog # re-catalog
person3.setNobReadTranslatedFirstName('ゆうすけ') person3.setNobReadTranslatedFirstName('ゆうすけ')
transaction.commit()
self.tic() self.tic()
result3 = portal.portal_catalog(content_translation_title='友介') result3 = portal.portal_catalog(content_translation_title='友介')
...@@ -108,7 +104,6 @@ class TestContentTranslation(ERP5TypeTestCase): ...@@ -108,7 +104,6 @@ class TestContentTranslation(ERP5TypeTestCase):
# un-catalog # un-catalog
portal.person_module.manage_delObjects(person3.getId()) portal.person_module.manage_delObjects(person3.getId())
transaction.commit()
self.tic() self.tic()
result4 = portal.portal_catalog(content_translation_title='村岡') result4 = portal.portal_catalog(content_translation_title='村岡')
...@@ -140,7 +135,6 @@ class TestContentTranslation(ERP5TypeTestCase): ...@@ -140,7 +135,6 @@ class TestContentTranslation(ERP5TypeTestCase):
portal_type='Person', portal_type='Person',
first_name='John', first_name='John',
last_name='Smith') last_name='Smith')
transaction.commit()
self.tic() self.tic()
self.assertEqual(getattr(person, 'setJaKanaTranslatedFirstName', False), self.assertEqual(getattr(person, 'setJaKanaTranslatedFirstName', False),
...@@ -155,7 +149,6 @@ class TestContentTranslation(ERP5TypeTestCase): ...@@ -155,7 +149,6 @@ class TestContentTranslation(ERP5TypeTestCase):
## ##
portal.Localizer._add_user_defined_language('Japanese Kana', 'ja-kana') portal.Localizer._add_user_defined_language('Japanese Kana', 'ja-kana')
portal.Localizer.add_language('ja-kana') portal.Localizer.add_language('ja-kana')
transaction.commit()
self.tic() self.tic()
self.assert_(getattr(person, 'setJaKanaTranslatedFirstName', False)) self.assert_(getattr(person, 'setJaKanaTranslatedFirstName', False))
...@@ -178,7 +171,6 @@ class TestContentTranslation(ERP5TypeTestCase): ...@@ -178,7 +171,6 @@ class TestContentTranslation(ERP5TypeTestCase):
self.assert_(person.hasJaKanaTranslatedFirstName()) self.assert_(person.hasJaKanaTranslatedFirstName())
transaction.commit()
self.tic() self.tic()
self.assert_('タハラ' in to_utf8(person.Base_viewContentTranslation())) self.assert_('タハラ' in to_utf8(person.Base_viewContentTranslation()))
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
import unittest import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
import transaction
class TestContributionRegistryTool(ERP5TypeTestCase): class TestContributionRegistryTool(ERP5TypeTestCase):
...@@ -70,7 +69,6 @@ return predicate.getDestinationPortalType() ...@@ -70,7 +69,6 @@ return predicate.getDestinationPortalType()
""") """)
self.portal.manage_addProduct['PythonScripts'].manage_addPythonScript(id='IngestionFile_testEvent') self.portal.manage_addProduct['PythonScripts'].manage_addPythonScript(id='IngestionFile_testEvent')
self.portal.IngestionFile_testEvent.write(python_script_src) self.portal.IngestionFile_testEvent.write(python_script_src)
transaction.commit()
self.tic() self.tic()
def setUpPredicate(self): def setUpPredicate(self):
...@@ -83,7 +81,6 @@ return predicate.getDestinationPortalType() ...@@ -83,7 +81,6 @@ return predicate.getDestinationPortalType()
id=predicate_id) id=predicate_id)
predicate.setCriterion('content_type', identity=['text/html']) predicate.setCriterion('content_type', identity=['text/html'])
predicate.setDestinationPortalType('Web Page') predicate.setDestinationPortalType('Web Page')
transaction.commit()
self.tic() self.tic()
predicate_id = 'webpage_by_extension' predicate_id = 'webpage_by_extension'
...@@ -93,7 +90,6 @@ return predicate.getDestinationPortalType() ...@@ -93,7 +90,6 @@ return predicate.getDestinationPortalType()
id=predicate_id) id=predicate_id)
predicate.setCriterion('extension_from_filename', identity=['html']) predicate.setCriterion('extension_from_filename', identity=['html'])
predicate.setDestinationPortalType('Web Page') predicate.setDestinationPortalType('Web Page')
transaction.commit()
self.tic() self.tic()
predicate_id = 'email_by_extension_and_content_type' predicate_id = 'email_by_extension_and_content_type'
...@@ -105,7 +101,6 @@ return predicate.getDestinationPortalType() ...@@ -105,7 +101,6 @@ return predicate.getDestinationPortalType()
predicate.setCriterion('content_type', identity=['message/rfc822']) predicate.setCriterion('content_type', identity=['message/rfc822'])
predicate.setDestinationPortalType('Mail Message') predicate.setDestinationPortalType('Mail Message')
predicate.setTestMethodId('IngestionFile_testEvent') predicate.setTestMethodId('IngestionFile_testEvent')
transaction.commit()
self.tic() self.tic()
predicate_id = 'text_by_extension' predicate_id = 'text_by_extension'
...@@ -115,7 +110,6 @@ return predicate.getDestinationPortalType() ...@@ -115,7 +110,6 @@ return predicate.getDestinationPortalType()
id=predicate_id) id=predicate_id)
predicate.setCriterion('extension_from_filename', identity=['odt', 'txt']) predicate.setCriterion('extension_from_filename', identity=['odt', 'txt'])
predicate.setDestinationPortalType('Text') predicate.setDestinationPortalType('Text')
transaction.commit()
self.tic() self.tic()
predicate_id = 'image_by_extension' predicate_id = 'image_by_extension'
...@@ -125,7 +119,6 @@ return predicate.getDestinationPortalType() ...@@ -125,7 +119,6 @@ return predicate.getDestinationPortalType()
id=predicate_id) id=predicate_id)
predicate.setCriterion('extension_from_filename', identity=['jpg', 'png']) predicate.setCriterion('extension_from_filename', identity=['jpg', 'png'])
predicate.setDestinationPortalType('Image') predicate.setDestinationPortalType('Image')
transaction.commit()
self.tic() self.tic()
def testFindPortalTypeName(self, quiet=0, run=run_all_test): def testFindPortalTypeName(self, quiet=0, run=run_all_test):
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
""" """
import unittest import unittest
import transaction
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase
...@@ -232,14 +231,13 @@ class CrmTestCase(ERP5ReportTestCase): ...@@ -232,14 +231,13 @@ class CrmTestCase(ERP5ReportTestCase):
doc.validate() doc.validate()
# and all this available to catalog # and all this available to catalog
transaction.commit()
self.tic() self.tic()
def beforeTearDown(self): def beforeTearDown(self):
"""Remove all documents. """Remove all documents.
""" """
transaction.abort() self.abort()
for module in (self.campaign_module, for module in (self.campaign_module,
self.meeting_module, self.meeting_module,
self.sale_opportunity_module, self.sale_opportunity_module,
...@@ -249,7 +247,6 @@ class CrmTestCase(ERP5ReportTestCase): ...@@ -249,7 +247,6 @@ class CrmTestCase(ERP5ReportTestCase):
self.event_module): self.event_module):
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
self.portal_categories['group'].manage_delObjects((['demo_group',])) self.portal_categories['group'].manage_delObjects((['demo_group',]))
transaction.commit()
self.tic() self.tic()
def getBusinessTemplateList(self): def getBusinessTemplateList(self):
...@@ -365,7 +362,6 @@ class TestCrmReports(CrmTestCase): ...@@ -365,7 +362,6 @@ class TestCrmReports(CrmTestCase):
causality=eventOut1.getRelativeUrl(), causality=eventOut1.getRelativeUrl(),
follow_up=second.getRelativeUrl()) follow_up=second.getRelativeUrl())
transaction.commit()
self.tic() self.tic()
request_form = self.portal.REQUEST.other request_form = self.portal.REQUEST.other
request_form['from_date'] = DateTime(2007, 1, 1) request_form['from_date'] = DateTime(2007, 1, 1)
...@@ -512,7 +508,6 @@ class TestCrmReports(CrmTestCase): ...@@ -512,7 +508,6 @@ class TestCrmReports(CrmTestCase):
causality=second_event_out1.getRelativeUrl(), causality=second_event_out1.getRelativeUrl(),
follow_up=second.getRelativeUrl()) follow_up=second.getRelativeUrl())
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
request_form = self.portal.REQUEST.other request_form = self.portal.REQUEST.other
...@@ -676,7 +671,6 @@ class TestCrmReports(CrmTestCase): ...@@ -676,7 +671,6 @@ class TestCrmReports(CrmTestCase):
causality=eventOut1.getRelativeUrl(), causality=eventOut1.getRelativeUrl(),
follow_up=second.getRelativeUrl()) follow_up=second.getRelativeUrl())
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
request_form = self.portal.REQUEST.other request_form = self.portal.REQUEST.other
...@@ -822,7 +816,6 @@ class TestCrmReports(CrmTestCase): ...@@ -822,7 +816,6 @@ class TestCrmReports(CrmTestCase):
causality=second_event_out1.getRelativeUrl(), causality=second_event_out1.getRelativeUrl(),
follow_up=second.getRelativeUrl()) follow_up=second.getRelativeUrl())
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
request_form = self.portal.REQUEST.other request_form = self.portal.REQUEST.other
...@@ -986,7 +979,6 @@ class TestCrmReports(CrmTestCase): ...@@ -986,7 +979,6 @@ class TestCrmReports(CrmTestCase):
causality=second_event_inc1.getRelativeUrl(), causality=second_event_inc1.getRelativeUrl(),
follow_up=second.getRelativeUrl()) follow_up=second.getRelativeUrl())
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
request_form = self.portal.REQUEST.other request_form = self.portal.REQUEST.other
...@@ -1132,7 +1124,6 @@ class TestCrmReports(CrmTestCase): ...@@ -1132,7 +1124,6 @@ class TestCrmReports(CrmTestCase):
causality=second_event_inc1.getRelativeUrl(), causality=second_event_inc1.getRelativeUrl(),
follow_up=second.getRelativeUrl()) follow_up=second.getRelativeUrl())
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
request_form = self.portal.REQUEST.other request_form = self.portal.REQUEST.other
...@@ -1296,7 +1287,6 @@ class TestCrmReports(CrmTestCase): ...@@ -1296,7 +1287,6 @@ class TestCrmReports(CrmTestCase):
causality=eventOut1.getRelativeUrl(), causality=eventOut1.getRelativeUrl(),
follow_up=second.getRelativeUrl()) follow_up=second.getRelativeUrl())
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
request_form = self.portal.REQUEST.other request_form = self.portal.REQUEST.other
...@@ -1442,7 +1432,6 @@ class TestCrmReports(CrmTestCase): ...@@ -1442,7 +1432,6 @@ class TestCrmReports(CrmTestCase):
causality=second_event_out1.getRelativeUrl(), causality=second_event_out1.getRelativeUrl(),
follow_up=second.getRelativeUrl()) follow_up=second.getRelativeUrl())
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
request_form = self.portal.REQUEST.other request_form = self.portal.REQUEST.other
...@@ -1701,7 +1690,6 @@ class TestCrmReports(CrmTestCase): ...@@ -1701,7 +1690,6 @@ class TestCrmReports(CrmTestCase):
causality=event6.getRelativeUrl(), causality=event6.getRelativeUrl(),
follow_up=campaign.getRelativeUrl()) follow_up=campaign.getRelativeUrl())
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
request_form = self.portal.REQUEST.other request_form = self.portal.REQUEST.other
...@@ -2044,7 +2032,6 @@ class TestCrmReports(CrmTestCase): ...@@ -2044,7 +2032,6 @@ class TestCrmReports(CrmTestCase):
causality=event6.getRelativeUrl(), causality=event6.getRelativeUrl(),
follow_up=campaign.getRelativeUrl()) follow_up=campaign.getRelativeUrl())
transaction.commit()
self.tic() self.tic()
# set request variables and render # set request variables and render
request_form = self.portal.REQUEST.other request_form = self.portal.REQUEST.other
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
############################################################################## ##############################################################################
import unittest import unittest
import transaction
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
...@@ -92,7 +91,6 @@ class TestDataProtection(ERP5TypeTestCase): ...@@ -92,7 +91,6 @@ class TestDataProtection(ERP5TypeTestCase):
document = portal.restrictedTraverse(sequence.get('document_relative_url')) document = portal.restrictedTraverse(sequence.get('document_relative_url'))
document.Base_addDataProtectionRequest( document.Base_addDataProtectionRequest(
description='I think the description is compromised') description='I think the description is compromised')
transaction.commit()
self.tic() self.tic()
data_protection = document.getAgentRelatedValueList( data_protection = document.getAgentRelatedValueList(
portal_type=portal_type)[0] portal_type=portal_type)[0]
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
############################################################################## ##############################################################################
import unittest import unittest
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import Sequence from Products.ERP5Type.tests.Sequence import Sequence
from Products.ERP5.tests.testPackingList import TestPackingListMixin from Products.ERP5.tests.testPackingList import TestPackingListMixin
...@@ -56,13 +55,12 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase): ...@@ -56,13 +55,12 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase):
validation_state="validated") validation_state="validated")
def beforeTearDown(self): def beforeTearDown(self):
transaction.abort() self.abort()
portal_rules = self.portal.portal_rules portal_rules = self.portal.portal_rules
rule_id_list = [rule_id for rule_id in portal_rules.objectIds() rule_id_list = [rule_id for rule_id in portal_rules.objectIds()
if rule_id.startswith('testDivergenceTester_')] if rule_id.startswith('testDivergenceTester_')]
if rule_id_list: if rule_id_list:
portal_rules.deleteContent(rule_id_list) portal_rules.deleteContent(rule_id_list)
transaction.commit()
self.tic() self.tic()
def stepResetDeliveringRule(self, sequence): def stepResetDeliveringRule(self, sequence):
...@@ -74,7 +72,6 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase): ...@@ -74,7 +72,6 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase):
new_rule_id = prefix + rule.getId() new_rule_id = prefix + rule.getId()
new_rule_reference = prefix + rule.getReference() new_rule_reference = prefix + rule.getReference()
rule = portal_rules.manage_clone(rule, new_rule_id) rule = portal_rules.manage_clone(rule, new_rule_id)
transaction.savepoint(optimistic=True)
rule.setVersion(str(int(rule.getVersion()) + 1)) rule.setVersion(str(int(rule.getVersion()) + 1))
rule.setReference(new_rule_reference) rule.setReference(new_rule_reference)
tester_list = rule.contentValues( tester_list = rule.contentValues(
...@@ -86,7 +83,6 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase): ...@@ -86,7 +83,6 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase):
if movement is not None: if movement is not None:
applied_rule = movement.getDeliveryRelatedValue().getParentValue() applied_rule = movement.getDeliveryRelatedValue().getParentValue()
applied_rule.setSpecialiseValue(rule) applied_rule.setSpecialiseValue(rule)
transaction.commit()
self.tic() self.tic()
sequence.edit(rule=rule) sequence.edit(rule=rule)
......
This diff is collapsed.
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
############################################################################## ##############################################################################
import unittest import unittest
import transaction
from Products.ERP5.tests.testInventoryAPI import InventoryAPITestCase from Products.ERP5.tests.testInventoryAPI import InventoryAPITestCase
class TestERP5Administration(InventoryAPITestCase): class TestERP5Administration(InventoryAPITestCase):
...@@ -53,7 +52,6 @@ class TestERP5Administration(InventoryAPITestCase): ...@@ -53,7 +52,6 @@ class TestERP5Administration(InventoryAPITestCase):
alarm = portal.portal_alarms.check_stock alarm = portal.portal_alarms.check_stock
def checkActiveProcess(failed): def checkActiveProcess(failed):
transaction.commit()
self.tic() self.tic()
self.assertEqual(alarm.getLastActiveProcess().ActiveProcess_sense(), self.assertEqual(alarm.getLastActiveProcess().ActiveProcess_sense(),
failed) failed)
...@@ -68,7 +66,6 @@ class TestERP5Administration(InventoryAPITestCase): ...@@ -68,7 +66,6 @@ class TestERP5Administration(InventoryAPITestCase):
alarm.setAlarmNotificationMode('never') alarm.setAlarmNotificationMode('never')
mvt = self._makeMovement(quantity=1.23) mvt = self._makeMovement(quantity=1.23)
transaction.commit()
self.tic() self.tic()
alarm.activeSense() alarm.activeSense()
checkActiveProcess(0) checkActiveProcess(0)
...@@ -107,7 +104,6 @@ class TestERP5Administration(InventoryAPITestCase): ...@@ -107,7 +104,6 @@ class TestERP5Administration(InventoryAPITestCase):
# this alarm can solve, as long as the constraints can solve, this is the # this alarm can solve, as long as the constraints can solve, this is the
# case of PropertyTypeValidity # case of PropertyTypeValidity
alarm.solve() alarm.solve()
transaction.commit()
self.tic() self.tic()
self.assertEquals('3', person.title) self.assertEquals('3', person.title)
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
import os import os
import unittest import unittest
import transaction
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.Utils import convertToUpperCase from Products.ERP5Type.Utils import convertToUpperCase
...@@ -81,11 +80,10 @@ class TestERP5Base(ERP5TypeTestCase): ...@@ -81,11 +80,10 @@ class TestERP5Base(ERP5TypeTestCase):
self.createCategories() self.createCategories()
def beforeTearDown(self): def beforeTearDown(self):
transaction.abort() self.abort()
for module in ( self.portal.person_module, for module in ( self.portal.person_module,
self.portal.organisation_module, ): self.portal.organisation_module, ):
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
transaction.commit()
self.tic() self.tic()
################################## ##################################
...@@ -515,7 +513,6 @@ class TestERP5Base(ERP5TypeTestCase): ...@@ -515,7 +513,6 @@ class TestERP5Base(ERP5TypeTestCase):
self._checkCategoryAccessorList(person, tested_base_category_list) self._checkCategoryAccessorList(person, tested_base_category_list)
# skill must be acquired on person # skill must be acquired on person
transaction.commit()
self.tic() self.tic()
category_dict_list = self.getCategoryDictList('skill') category_dict_list = self.getCategoryDictList('skill')
skill_object_list = [] skill_object_list = []
...@@ -1037,7 +1034,6 @@ class TestERP5Base(ERP5TypeTestCase): ...@@ -1037,7 +1034,6 @@ class TestERP5Base(ERP5TypeTestCase):
active_process = portal_activities.newActiveProcess() active_process = portal_activities.newActiveProcess()
portal_activities.ERP5Site_checkDataWithScript(method_id=test, tag=test, portal_activities.ERP5Site_checkDataWithScript(method_id=test, tag=test,
active_process=active_process.getPath()) active_process=active_process.getPath())
transaction.commit()
self.tic() self.tic()
relative_url_list = sum((x.detail.split('\n') relative_url_list = sum((x.detail.split('\n')
for x in active_process.getResultList()), []) for x in active_process.getResultList()), [])
...@@ -1070,7 +1066,6 @@ class TestERP5Base(ERP5TypeTestCase): ...@@ -1070,7 +1066,6 @@ class TestERP5Base(ERP5TypeTestCase):
person_2 = self.portal.person_module.newContent(portal_type='Person') person_2 = self.portal.person_module.newContent(portal_type='Person')
organisation = self.portal.organisation_module.newContent( organisation = self.portal.organisation_module.newContent(
portal_type='Organisation') portal_type='Organisation')
transaction.commit()
self.tic() self.tic()
# patch the method, we'll abort later # patch the method, we'll abort later
...@@ -1087,7 +1082,7 @@ class TestERP5Base(ERP5TypeTestCase): ...@@ -1087,7 +1082,7 @@ class TestERP5Base(ERP5TypeTestCase):
[x.getObject() for x in [x.getObject() for x in
self.portal.portal_catalog(translated_validation_state_title='Brouillon', self.portal.portal_catalog(translated_validation_state_title='Brouillon',
translated_portal_type='Personne')]) translated_portal_type='Personne')])
transaction.abort() self.abort()
def test_Base_createCloneDocument(self): def test_Base_createCloneDocument(self):
module = self.portal.person_module module = self.portal.person_module
...@@ -1168,7 +1163,6 @@ class TestERP5Base(ERP5TypeTestCase): ...@@ -1168,7 +1163,6 @@ class TestERP5Base(ERP5TypeTestCase):
reference='user_login', reference='user_login',
password='pass', password='pass',
password_confirm='pass') password_confirm='pass')
transaction.commit()
self.tic() self.tic()
# a user is created # a user is created
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
############################################################################## ##############################################################################
import unittest import unittest
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.Base import _aq_reset from Products.ERP5Type.Base import _aq_reset
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
...@@ -90,7 +89,7 @@ class TestERP5Category(ERP5TypeTestCase): ...@@ -90,7 +89,7 @@ class TestERP5Category(ERP5TypeTestCase):
type_info = self.getTypeTool().Organisation type_info = self.getTypeTool().Organisation
type_info._setTypeBaseCategoryList([self.base_cat, self.base_cat2]) type_info._setTypeBaseCategoryList([self.base_cat, self.base_cat2])
transaction.commit() self.commit()
organisation_module = self.getOrganisationModule() organisation_module = self.getOrganisationModule()
if not organisation_module.has_key('1'): if not organisation_module.has_key('1'):
...@@ -137,7 +136,7 @@ class TestERP5Category(ERP5TypeTestCase): ...@@ -137,7 +136,7 @@ class TestERP5Category(ERP5TypeTestCase):
predicate.setCriterion('quantity', identity=None, min=None, max=None) predicate.setCriterion('quantity', identity=None, min=None, max=None)
self.predicate = predicate self.predicate = predicate
transaction.commit() # If we don't commit, then we can't rename self.commit()# If we don't commit, then we can't rename
self.tic() self.tic()
def beforeTearDown(self): def beforeTearDown(self):
...@@ -166,7 +165,6 @@ class TestERP5Category(ERP5TypeTestCase): ...@@ -166,7 +165,6 @@ class TestERP5Category(ERP5TypeTestCase):
def commitAndTic(self): def commitAndTic(self):
"""Just to save one line. """Just to save one line.
""" """
transaction.commit()
self.tic() self.tic()
def test_01_RenameCategory(self, quiet=quiet, run=run_all_test): def test_01_RenameCategory(self, quiet=quiet, run=run_all_test):
...@@ -321,7 +319,7 @@ class TestERP5Category(ERP5TypeTestCase): ...@@ -321,7 +319,7 @@ class TestERP5Category(ERP5TypeTestCase):
ttool = self.getTypesTool() ttool = self.getTypesTool()
ttool['Organisation']._setTypeBaseCategoryList(['test_aq_category']) ttool['Organisation']._setTypeBaseCategoryList(['test_aq_category'])
ttool['Telephone']._setTypeBaseCategoryList(['test_aq_category']) ttool['Telephone']._setTypeBaseCategoryList(['test_aq_category'])
transaction.commit() self.commit()
doc = self.organisation doc = self.organisation
subdoc = doc['1'] subdoc = doc['1']
...@@ -339,7 +337,7 @@ class TestERP5Category(ERP5TypeTestCase): ...@@ -339,7 +337,7 @@ class TestERP5Category(ERP5TypeTestCase):
self.assertEquals([], ctool.getAcquiredCategoryList(doc)) self.assertEquals([], ctool.getAcquiredCategoryList(doc))
# XXX this test's beforeTearDown commits transaction # XXX this test's beforeTearDown commits transaction
transaction.abort() self.abort()
def test_suite(): def test_suite():
......
This diff is collapsed.
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
import os import os
import unittest import unittest
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
...@@ -53,11 +52,10 @@ class TestERP5Coordinate(ERP5TypeTestCase): ...@@ -53,11 +52,10 @@ class TestERP5Coordinate(ERP5TypeTestCase):
'erp5_base',) 'erp5_base',)
def beforeTearDown(self): def beforeTearDown(self):
transaction.abort() self.abort()
for module in ( self.portal.person_module, for module in ( self.portal.person_module,
self.portal.organisation_module, ): self.portal.organisation_module, ):
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
transaction.commit()
self.tic() self.tic()
def test_data_coordinate_text_property(self): def test_data_coordinate_text_property(self):
......
This diff is collapsed.
This diff is collapsed.
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
############################################################################## ##############################################################################
import unittest import unittest
import transaction
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.backportUnittest import expectedFailure from Products.ERP5Type.tests.backportUnittest import expectedFailure
...@@ -71,10 +70,9 @@ class TestERP5Discussion(ERP5TypeTestCase): ...@@ -71,10 +70,9 @@ class TestERP5Discussion(ERP5TypeTestCase):
self.auth = '%s:%s' % (self.manager_username, self.manager_password) self.auth = '%s:%s' % (self.manager_username, self.manager_password)
def beforeTearDown(self): def beforeTearDown(self):
transaction.abort() self.abort()
for module in (self.portal.discussion_thread_module,): for module in (self.portal.discussion_thread_module,):
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
transaction.commit()
self.tic() self.tic()
def stepCreateThread(self): def stepCreateThread(self):
......
...@@ -30,7 +30,6 @@ This test is experimental for new simulation implementation. ...@@ -30,7 +30,6 @@ This test is experimental for new simulation implementation.
""" """
import unittest import unittest
import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
...@@ -52,7 +51,6 @@ class TestERP5Simulation(TestPackingListMixin, ERP5TypeTestCase): ...@@ -52,7 +51,6 @@ class TestERP5Simulation(TestPackingListMixin, ERP5TypeTestCase):
self.portal.portal_rules.new_delivery_simulation_rule.quantity_tester.edit( self.portal.portal_rules.new_delivery_simulation_rule.quantity_tester.edit(
quantity_range_max=None, quantity_range_max=None,
quantity_range_min=None) quantity_range_min=None)
transaction.commit()
self.tic() self.tic()
def _modifyPackingListLineQuantity(self, sequence=None, def _modifyPackingListLineQuantity(self, sequence=None,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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