[CMF-checkins] SVN: CMF/branches/1.6/C - CMFCalendar: Refactored
test setup to fix test breakage for Zope 2.9.
Jens Vagelpohl
jens at dataflake.org
Mon Oct 23 14:26:54 EDT 2006
Log message for revision 70893:
- CMFCalendar: Refactored test setup to fix test breakage for Zope 2.9.
Changed:
U CMF/branches/1.6/CHANGES.txt
U CMF/branches/1.6/CMFCalendar/tests/test_Calendar.py
-=-
Modified: CMF/branches/1.6/CHANGES.txt
===================================================================
--- CMF/branches/1.6/CHANGES.txt 2006-10-23 15:07:38 UTC (rev 70892)
+++ CMF/branches/1.6/CHANGES.txt 2006-10-23 18:26:54 UTC (rev 70893)
@@ -2,6 +2,8 @@
Bug Fixes
+ - CMFCalendar: Refactored test setup to fix test breakage for Zope 2.9.
+
- CMFDefault: The "Sample CMF Content" GenericSetup profile was
registered but missing all of its files and necessary interface
declarations in the CMFDefault content classes.
Modified: CMF/branches/1.6/CMFCalendar/tests/test_Calendar.py
===================================================================
--- CMF/branches/1.6/CMFCalendar/tests/test_Calendar.py 2006-10-23 15:07:38 UTC (rev 70892)
+++ CMF/branches/1.6/CMFCalendar/tests/test_Calendar.py 2006-10-23 18:26:54 UTC (rev 70893)
@@ -30,7 +30,8 @@
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.User import UnrestrictedUser
from DateTime import DateTime
-from Products.ExternalMethod.ExternalMethod import manage_addExternalMethod
+import Products
+from Products.Five import zcml
from Products.TemporaryFolder.TemporaryFolder import MountedTemporaryFolder
from Products.Transience.Transience import TransientObjectContainer
from Products.CMFCore.tests.base.testcase import WarningInterceptor
@@ -43,7 +44,15 @@
from Products.CMFCore.utils import transaction
from Products.CMFCore import Skinnable
+try:
+ from zope.testing.cleanup import cleanUp
+except:
+ # BBB: for Zope 2.8
+ from zope.testing.cleanup import CleanUp
+ cleanup_ob = CleanUp()
+ cleanUp = cleanup_ob.cleanUp
+
class CalendarTests(unittest.TestCase):
def _makeOne(self, *args, **kw):
@@ -88,6 +97,12 @@
def setUp(self):
self._trap_warning_output()
+ zcml.load_config('meta.zcml', Products.Five)
+ zcml.load_config('configure.zcml', Products.Five)
+ zcml.load_config('configure.zcml', Products.GenericSetup)
+ zcml.load_config('configure.zcml', Products.CMFCore)
+ zcml.load_config('configure.zcml', Products.CMFDefault)
+ zcml.load_config('configure.zcml', Products.DCWorkflow)
self._oldSkindata = Skinnable.SKINDATA.copy()
transaction.begin()
@@ -96,24 +111,14 @@
newSecurityManager(None,
UnrestrictedUser('god', 'god', ['Manager'], '') )
- #app.manage_addProduct['CMFDefault'].manage_addCMFSite('CalendarTest')
- addConfiguredSite(app, 'CalendarTest', 'CMFDefault:default')
+ factory = app.manage_addProduct['CMFDefault'].addConfiguredSite
+ factory('CalendarTest', 'CMFDefault:default', snapshot=False,
+ extension_ids=('CMFCalendar:default',))
self.Site = app.CalendarTest
- manage_addExternalMethod(app.CalendarTest,
- id='install_events',
- title="Install Events",
- module="CMFCalendar.Install",
- function="install")
-
- ExMethod = app.restrictedTraverse('/CalendarTest/install_events')
- ExMethod()
self.Tool = app.CalendarTest.portal_calendar
- self.Site.clearCurrentSkin()
- self.Site.setupCurrentSkin(app.REQUEST)
-
# sessioning setup
if getattr(app, 'temp_folder', None) is None:
temp_folder = MountedTemporaryFolder('temp_folder')
@@ -131,6 +136,7 @@
self.app._p_jar.close()
Skinnable.SKINDATA = self._oldSkindata
self._free_warning_output()
+ cleanUp()
def _testURL(self,url,params=None):
Site = self.Site
More information about the CMF-checkins
mailing list