[CMF-checkins] CVS: Products/CMFCalendar/tests -
test_Calendar.py:1.12.2.5
Yvo Schubbe
y.2005- at wcm-solutions.de
Tue Apr 5 05:25:50 EDT 2005
Update of /cvs-repository/Products/CMFCalendar/tests
In directory cvs.zope.org:/tmp/cvs-serv3869/CMFCalendar/tests
Modified Files:
Tag: CMF-1_5-branch
test_Calendar.py
Log Message:
- replaced get_transaction() by the transaction API used in Zope 2.8
- added utils.transaction for Zope 2.7 compatibility
- replaced commit() by commit(1) in test_PortalFolder.py
- related import and whitespace cleanup
=== Products/CMFCalendar/tests/test_Calendar.py 1.12.2.4 => 1.12.2.5 ===
--- Products/CMFCalendar/tests/test_Calendar.py:1.12.2.4 Sun Apr 3 17:59:50 2005
+++ Products/CMFCalendar/tests/test_Calendar.py Tue Apr 5 05:25:19 2005
@@ -17,8 +17,12 @@
import unittest
import Testing
-import Zope
-Zope.startup()
+try:
+ import Zope2
+except ImportError:
+ # BBB: for Zope 2.7
+ import Zope as Zope2
+Zope2.startup()
import locale
@@ -30,6 +34,11 @@
from Products.TemporaryFolder.TemporaryFolder import MountedTemporaryFolder
from Products.Transience.Transience import TransientObjectContainer
from Testing.makerequest import makerequest
+try:
+ import transaction
+except ImportError:
+ # BBB: for Zope 2.7
+ from Products.CMFCore.utils import transaction
class CalendarTests(unittest.TestCase):
@@ -75,9 +84,9 @@
class CalendarRequestTests(unittest.TestCase):
def setUp(self):
- get_transaction().begin()
+ transaction.begin()
- app = self.app = makerequest(Zope.app())
+ app = self.app = makerequest(Zope2.app())
# Log in as a god :-)
newSecurityManager( None, UnrestrictedUser('god', 'god', ['Manager'], '') )
@@ -110,7 +119,7 @@
def tearDown(self):
noSecurityManager()
- get_transaction().abort()
+ transaction.abort()
self.app._p_jar.close()
def _testURL(self,url,params=None):
More information about the CMF-checkins
mailing list