[CMF-checkins] CVS: Products/CMFCalendar/tests -
test_Calendar.py:1.20
Yvo Schubbe
y.2005- at wcm-solutions.de
Tue Apr 5 05:27:24 EDT 2005
Update of /cvs-repository/Products/CMFCalendar/tests
In directory cvs.zope.org:/tmp/cvs-serv4750/CMFCalendar/tests
Modified Files:
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.19 => 1.20 ===
--- Products/CMFCalendar/tests/test_Calendar.py:1.19 Sun Apr 3 18:00:17 2005
+++ Products/CMFCalendar/tests/test_Calendar.py Tue Apr 5 05:26:53 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
@@ -29,6 +33,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):
@@ -74,9 +83,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'], '') )
@@ -98,7 +107,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