Commit 886d8254 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Try to import transaction.get as get_transaction for ZODB 3.5 or later.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4014 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b71cc88b
......@@ -32,6 +32,11 @@ from Products.CMFActivity.ActiveObject import DISTRIBUTABLE_STATE, INVOKE_ERROR_
from zLOG import LOG
try:
from transaction import get as get_transaction
except ImportError:
pass
class RAMDict(Queue):
"""
A simple RAM based queue. It is not compatible with transactions which
......
......@@ -30,6 +30,11 @@ from Products.CMFActivity.ActivityTool import registerActivity
from Queue import Queue, VALID
from Products.CMFActivity.ActiveObject import DISTRIBUTABLE_STATE, INVOKE_ERROR_STATE, VALIDATE_ERROR_STATE
try:
from transaction import get as get_transaction
except ImportError:
pass
class RAMQueue(Queue):
"""
A simple RAM based queue
......
......@@ -34,6 +34,11 @@ from RAMDict import RAMDict
from Products.CMFActivity.ActiveObject import DISTRIBUTABLE_STATE, INVOKE_ERROR_STATE, VALIDATE_ERROR_STATE
from ZODB.POSException import ConflictError
try:
from transaction import get as get_transaction
except ImportError:
pass
from zLOG import LOG
MAX_PRIORITY = 5
......
......@@ -33,6 +33,11 @@ from DateTime import DateTime
from Queue import VALID, INVALID_ORDER, INVALID_PATH, EXCEPTION, MAX_PROCESSING_TIME, VALIDATION_ERROR_DELAY, SECONDS_IN_DAY
from Products.CMFActivity.ActiveObject import DISTRIBUTABLE_STATE, INVOKE_ERROR_STATE, VALIDATE_ERROR_STATE
try:
from transaction import get as get_transaction
except ImportError:
pass
from zLOG import LOG
MAX_PRIORITY = 5
......
......@@ -27,6 +27,11 @@ from Shared.DC.ZRDB.TM import TM
from zLOG import LOG, ERROR, INFO
import sys
try:
from transaction import get as get_transaction
except ImportError:
pass
class ActivityBuffer(TM):
_p_oid=_p_changed=_registered=None
......
......@@ -50,6 +50,11 @@ from Acquisition import aq_base, aq_inner
from zLOG import LOG
import time
try:
from transaction import get as get_transaction
except ImportError:
pass
class TestCMFActivity(ERP5TypeTestCase):
run_all_test = 1
......
......@@ -48,6 +48,11 @@ from AccessControl.SecurityManagement import newSecurityManager, noSecurityManag
from zLOG import LOG
import time
try:
from transaction import get as get_transaction
except ImportError:
pass
class TestCMFCategory(ERP5TypeTestCase):
# Different variables used for this test
......
......@@ -70,6 +70,11 @@ from email import Encoders
from socket import gethostname, gethostbyaddr
import random
try:
from transaction import get as get_transaction
except ImportError:
pass
from zLOG import LOG, INFO, ERROR, WARNING
class WorkflowMethod(Method):
......
......@@ -14,6 +14,11 @@ from Products.ERP5Type.Utils import getLocalDocumentList, removeLocalDocument
from Products.ERP5Type.Utils import getLocalConstraintList, removeLocalConstraint
from zLOG import LOG
try:
from transaction import get as get_transaction
except ImportError:
pass
# Std Zope Products
ZopeTestCase.installProduct('ExtFile')
ZopeTestCase.installProduct('Photo')
......@@ -127,7 +132,7 @@ class ERP5TypeTestCase(PortalTestCase):
Most of the time, we need to login before doing anything
"""
uf = self.getPortal().acl_users
uf._doAddUser('ERP5TypeTestCase', '', ['Manager'], [])
uf._doAddUser('ERP5TypeTestCase', '', ['Manager', 'Member'], [])
user = uf.getUserById('ERP5TypeTestCase').__of__(uf)
newSecurityManager(None, user)
......
......@@ -30,6 +30,11 @@ from Testing import ZopeTestCase
from zLOG import LOG
import random
try:
from transaction import get as get_transaction
except ImportError:
pass
class Step:
def __init__(self,method_name='',required=1,max_replay=1):
......
......@@ -44,7 +44,10 @@ from Products.ERP5Type.Utils import cartesianProduct
from AccessControl.SecurityManagement import newSecurityManager, noSecurityManager
from zLOG import LOG
from zLOG import LOG
try:
from transaction import get as get_transaction
except ImportError:
pass
class TestXMLMatrix(ERP5TypeTestCase):
......
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