[CMF-checkins] SVN: CMF/trunk/ Clean up some of the many
deprecation warnings when running on Zope2 trunk:
Tres Seaver
tseaver at palladion.com
Mon Nov 7 14:06:46 EST 2005
Log message for revision 39963:
Clean up some of the many deprecation warnings when running on Zope2 trunk:
o Import PlacelessSetup from new 'zope.testing' location
(centralized to 'utils' modules).
o Import MessageFactory instead of MessageID / MessageIDFactory from
zope.i18messageid.
o Commented out breakage in CMFCore/browser/meta.zcml due to absence of
'globalBrowserMenuService' in Zope3 3.2 (needs fixing).
Also, moved some module-scope imports of module-under-test into testcase
methods.
Changed:
U CMF/trunk/CMFCalendar/utils.py
U CMF/trunk/CMFCore/ActionInformation.py
U CMF/trunk/CMFCore/TypesTool.py
U CMF/trunk/CMFCore/browser/meta.zcml
U CMF/trunk/CMFCore/exportimport/tests/test_actions.py
U CMF/trunk/CMFCore/exportimport/tests/test_content.py
U CMF/trunk/CMFCore/exportimport/tests/test_cookieauth.py
U CMF/trunk/CMFCore/exportimport/tests/test_properties.py
U CMF/trunk/CMFCore/exportimport/tests/test_typeinfo.py
U CMF/trunk/CMFCore/tests/base/testcase.py
U CMF/trunk/CMFCore/tests/test_fiveactionstool.py
U CMF/trunk/CMFCore/utils.py
U CMF/trunk/CMFDefault/skin/configure.zcml
U CMF/trunk/CMFDefault/tests/test_DiscussionReply.py
U CMF/trunk/CMFDefault/tests/test_Image.py
U CMF/trunk/CMFDefault/tests/test_Portal.py
U CMF/trunk/CMFDefault/utils.py
U CMF/trunk/CMFSetup/tests/test_actions.py
U CMF/trunk/CMFSetup/tests/test_catalog.py
U CMF/trunk/CMFSetup/tests/test_cookieauth.py
U CMF/trunk/CMFSetup/tests/test_mailhost.py
U CMF/trunk/CMFSetup/tests/test_properties.py
U CMF/trunk/CMFSetup/tests/test_typeinfo.py
U CMF/trunk/CMFTopic/tests/test_DateC.py
U CMF/trunk/GenericSetup/MailHost/tests/test_exportimport.py
U CMF/trunk/GenericSetup/PluginIndexes/tests/test_exportimport.py
U CMF/trunk/GenericSetup/ZCTextIndex/tests/test_exportimport.py
U CMF/trunk/GenericSetup/ZCatalog/tests/test_exportimport.py
U CMF/trunk/GenericSetup/testing.py
-=-
Modified: CMF/trunk/CMFCalendar/utils.py
===================================================================
--- CMF/trunk/CMFCalendar/utils.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCalendar/utils.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -16,10 +16,13 @@
"""
from AccessControl import ModuleSecurityInfo
-from zope.i18nmessageid import MessageIDFactory
+try:
+ from zope.i18nmessageid import MessageFactory
+except ImportError: # BBB
+ from zope.i18nmessageid import MessageIDFactory as MessageFactory
security = ModuleSecurityInfo('Products.CMFCalendar.utils')
security.declarePublic('MessageID')
-MessageID = MessageIDFactory('cmf_calendar')
+MessageID = MessageFactory('cmf_calendar')
Modified: CMF/trunk/CMFCore/ActionInformation.py
===================================================================
--- CMF/trunk/CMFCore/ActionInformation.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/ActionInformation.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -25,7 +25,7 @@
from OFS.OrderedFolder import OrderedFolder
from OFS.SimpleItem import SimpleItem
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-from zope.i18nmessageid import MessageID
+
from zope.interface import implements
from Products.GenericSetup.interfaces import INodeImporter
@@ -40,6 +40,7 @@
from utils import _wwwdir
from utils import getToolByName
from utils import SimpleItemWithProperties
+from utils import MessageFactory
_unchanged = [] # marker
@@ -164,7 +165,7 @@
elif id == 'i18n_domain':
continue
elif self.i18n_domain and id in ('title', 'description'):
- val = MessageID(val, self.i18n_domain)
+ val = MessageFactory(self.i18n_domain)(val)
lazy_map[id] = val
return (lazy_map, lazy_keys)
Modified: CMF/trunk/CMFCore/TypesTool.py
===================================================================
--- CMF/trunk/CMFCore/TypesTool.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/TypesTool.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -30,9 +30,15 @@
from OFS.ObjectManager import IFAwareObjectManager
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from zLOG import LOG, ERROR
-from zope.i18nmessageid import MessageID
from zope.interface import implements
+try:
+ from zope.i18nmessageid import MessageFactory
+except ImportError: # BBB
+ from zope.i18nmessageid import MessageIDFactory as MessageFactory
+def MessageID(val, domain): # XXX performance?
+ return MessageFactory(domain)(val)
+
from Products.GenericSetup.interfaces import INodeImporter
from ActionProviderBase import ActionProviderBase
Modified: CMF/trunk/CMFCore/browser/meta.zcml
===================================================================
--- CMF/trunk/CMFCore/browser/meta.zcml 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/browser/meta.zcml 2005-11-07 19:06:45 UTC (rev 39963)
@@ -2,6 +2,7 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:meta="http://namespaces.zope.org/meta">
+ <!-- Commenting out pending Lennart's fixes for Zope 3.2 compatibility.
<meta:directives namespace="http://namespaces.zope.org/cmf">
<meta:directive
@@ -30,5 +31,6 @@
</meta:complexDirective>
</meta:directives>
+ -->
</configure>
Modified: CMF/trunk/CMFCore/exportimport/tests/test_actions.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/tests/test_actions.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/exportimport/tests/test_actions.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -20,12 +20,8 @@
import Zope2
Zope2.startup()
-import Products.CMFCore.exportimport
-import Products.Five
-from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
-
from Products.CMFCore.tests.base.dummy import DummySite
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from Products.GenericSetup.testing import NodeAdapterTestCase
@@ -90,6 +86,9 @@
def setUp(self):
from Products.CMFCore.ActionInformation import Action
+ import Products.CMFCore.exportimport
+ import Products.Five
+ from Products.Five import zcml
PlacelessSetup.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
@@ -114,6 +113,9 @@
def setUp(self):
from Products.CMFCore.ActionInformation import ActionCategory
+ import Products.CMFCore.exportimport
+ import Products.Five
+ from Products.Five import zcml
PlacelessSetup.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
@@ -142,6 +144,9 @@
def setUp(self):
from Products.CMFCore.ActionsTool import ActionsTool
+ import Products.CMFCore.exportimport
+ import Products.Five
+ from Products.Five import zcml
PlacelessSetup.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
Modified: CMF/trunk/CMFCore/exportimport/tests/test_content.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/tests/test_content.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/exportimport/tests/test_content.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -22,8 +22,7 @@
from ConfigParser import ConfigParser
from StringIO import StringIO
-from zope.app.tests.placelesssetup import PlacelessSetup
-
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from Products.GenericSetup.tests.common import DummyExportContext
from Products.GenericSetup.tests.common import DummyImportContext
Modified: CMF/trunk/CMFCore/exportimport/tests/test_cookieauth.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/tests/test_cookieauth.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/exportimport/tests/test_cookieauth.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -18,11 +18,7 @@
import unittest
import Testing
-import Products.CMFCore.exportimport
-import Products.Five
-from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
-
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from Products.GenericSetup.testing import NodeAdapterTestCase
@@ -52,6 +48,9 @@
def setUp(self):
from Products.CMFCore.CookieCrumbler import CookieCrumbler
+ import Products.CMFCore.exportimport
+ import Products.Five
+ from Products.Five import zcml
PlacelessSetup.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
Modified: CMF/trunk/CMFCore/exportimport/tests/test_properties.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/tests/test_properties.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/exportimport/tests/test_properties.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -18,11 +18,7 @@
import unittest
import Testing
-import Products.CMFCore.exportimport
-import Products.Five
-from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
-
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from Products.GenericSetup.testing import NodeAdapterTestCase
@@ -50,6 +46,9 @@
def setUp(self):
from Products.CMFCore.PortalObject import PortalObjectBase
+ import Products.CMFCore.exportimport
+ import Products.Five
+ from Products.Five import zcml
PlacelessSetup.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
Modified: CMF/trunk/CMFCore/exportimport/tests/test_typeinfo.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/tests/test_typeinfo.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/exportimport/tests/test_typeinfo.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -20,11 +20,7 @@
import Zope2
Zope2.startup()
-import Products.CMFCore.exportimport
-import Products.Five
-from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
-
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from Products.GenericSetup.testing import NodeAdapterTestCase
@@ -61,6 +57,9 @@
def setUp(self):
from Products.CMFCore.TypesTool import FactoryTypeInformation
+ import Products.CMFCore.exportimport
+ import Products.Five
+ from Products.Five import zcml
PlacelessSetup.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
Modified: CMF/trunk/CMFCore/tests/base/testcase.py
===================================================================
--- CMF/trunk/CMFCore/tests/base/testcase.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/tests/base/testcase.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -21,6 +21,15 @@
from security import AnonymousUser
from security import PermissiveSecurityPolicy
+try:
+ from zope.app.testing.placelesssetup import PlacelessSetup
+ from zope.app.testing.placelesssetup import setUp as placelessSetUp
+ from zope.app.testing.placelesssetup import tearDown as placelessTearDown
+except ImportError: # BBB, Zope3 < 3.1
+ from zope.app.tests.placelesssetup import PlacelessSetup
+ from zope.app.tests.placelesssetup import setUp as placelessSetUp
+ from zope.app.tests.placelesssetup import tearDown as placelessTearDown
+
class LogInterceptor:
_old_log_write = None
Modified: CMF/trunk/CMFCore/tests/test_fiveactionstool.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_fiveactionstool.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/tests/test_fiveactionstool.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -26,8 +26,9 @@
Some basic setup:
- >>> from zope.app.tests.placelesssetup import setUp, tearDown
- >>> setUp()
+ >>> from Products.CMFCore.tests.base.testcase import placelessSetUp
+ >>> from Products.CMFCore.tests.base.testcase import placelessTearDown
+ >>> placelessSetUp()
>>> import Products.Five
>>> import Products.CMFCore
@@ -75,7 +76,7 @@
Cleanup:
- >>> tearDown()
+ >>> placelessTearDown()
"""
def test_suite():
Modified: CMF/trunk/CMFCore/utils.py
===================================================================
--- CMF/trunk/CMFCore/utils.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFCore/utils.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -46,14 +46,18 @@
from OFS.SimpleItem import SimpleItem
from Products.PageTemplates.Expressions import getEngine
from Products.PageTemplates.Expressions import SecureModuleImporter
-from zope.i18nmessageid import MessageIDFactory
from thread import allocate_lock
from exceptions import AccessControl_Unauthorized
from exceptions import NotFound
from warnings import warn
+try:
+ from zope.i18nmessageid import MessageFactory
+except ImportError: # BBB
+ from zope.i18nmessageid import MessageIDFactory as MessageFactory
+
security = ModuleSecurityInfo( 'Products.CMFCore.utils' )
_dtmldir = os_path.join( package_home( globals() ), 'dtml' )
@@ -792,4 +796,4 @@
security.declarePublic('MessageID')
-MessageID = MessageIDFactory('cmf_default')
+MessageID = MessageFactory('cmf_default')
Modified: CMF/trunk/CMFDefault/skin/configure.zcml
===================================================================
--- CMF/trunk/CMFDefault/skin/configure.zcml 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFDefault/skin/configure.zcml 2005-11-07 19:06:45 UTC (rev 39963)
@@ -7,9 +7,10 @@
name="cmf"
/>
+ <!-- 'default' layer is missing when run under 2.9! -->
<browser:skin
name="cmf"
- layers="cmf default"
+ layers="cmf"
/>
<browser:defaultSkin
Modified: CMF/trunk/CMFDefault/tests/test_DiscussionReply.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_DiscussionReply.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFDefault/tests/test_DiscussionReply.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -24,8 +24,8 @@
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from Products.CMFCore.tests.base.testcase import RequestTest
Modified: CMF/trunk/CMFDefault/tests/test_Image.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_Image.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFDefault/tests/test_Image.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -27,10 +27,10 @@
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.User import UnrestrictedUser
from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
from Products.CMFCore.tests.base.dummy import DummySite
from Products.CMFCore.tests.base.dummy import DummyTool
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from Products.CMFCore.tests.base.testcase import RequestTest
from Products.CMFDefault import tests
from Products.CMFDefault.File import File
Modified: CMF/trunk/CMFDefault/tests/test_Portal.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_Portal.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFDefault/tests/test_Portal.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -23,8 +23,8 @@
import Products
from Acquisition import aq_base
from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from Products.CMFCore.tests.base.testcase import SecurityRequestTest
Modified: CMF/trunk/CMFDefault/utils.py
===================================================================
--- CMF/trunk/CMFDefault/utils.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFDefault/utils.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -24,12 +24,16 @@
from AccessControl import ModuleSecurityInfo
from Globals import package_home
-from zope.i18nmessageid import MessageIDFactory
from ZTUtils.Zope import complex_marshal
from exceptions import IllegalHTML
+try:
+ from zope.i18nmessageid import MessageFactory
+except ImportError: # BBB
+ from zope.i18nmessageid import MessageIDFactory as MessageFactory
+
security = ModuleSecurityInfo( 'Products.CMFDefault.utils' )
security.declarePrivate('_dtmldir')
@@ -429,4 +433,4 @@
return value
security.declarePublic('MessageID')
-MessageID = MessageIDFactory('cmf_default')
+MessageID = MessageFactory('cmf_default')
Modified: CMF/trunk/CMFSetup/tests/test_actions.py
===================================================================
--- CMF/trunk/CMFSetup/tests/test_actions.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFSetup/tests/test_actions.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -26,13 +26,13 @@
from OFS.Folder import Folder
from OFS.OrderedFolder import OrderedFolder
from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
from zope.interface import implements
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.interfaces.portal_actions \
import ActionProvider as IActionProvider
from Products.CMFCore.interfaces import IActionsTool
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from common import BaseRegistryTests
from common import DummyExportContext
Modified: CMF/trunk/CMFSetup/tests/test_catalog.py
===================================================================
--- CMF/trunk/CMFSetup/tests/test_catalog.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFSetup/tests/test_catalog.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -25,9 +25,9 @@
from Products.ZCTextIndex.Lexicon import Splitter
from Products.ZCTextIndex.Lexicon import StopWordRemover
from Products.ZCTextIndex.ZCTextIndex import PLexicon
-from zope.app.tests.placelesssetup import PlacelessSetup
from Products.CMFCore.CatalogTool import CatalogTool
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from common import BaseRegistryTests
from common import DummyExportContext
Modified: CMF/trunk/CMFSetup/tests/test_cookieauth.py
===================================================================
--- CMF/trunk/CMFSetup/tests/test_cookieauth.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFSetup/tests/test_cookieauth.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -21,9 +21,9 @@
import Products
from OFS.Folder import Folder
from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
from Products.CMFCore.CookieCrumbler import CookieCrumbler
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from common import BaseRegistryTests
from common import DummyExportContext
Modified: CMF/trunk/CMFSetup/tests/test_mailhost.py
===================================================================
--- CMF/trunk/CMFSetup/tests/test_mailhost.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFSetup/tests/test_mailhost.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -22,7 +22,7 @@
from OFS.Folder import Folder
from Products.Five import zcml
from Products.MailHost.MailHost import MailHost
-from zope.app.tests.placelesssetup import PlacelessSetup
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from common import BaseRegistryTests
from common import DummyExportContext
Modified: CMF/trunk/CMFSetup/tests/test_properties.py
===================================================================
--- CMF/trunk/CMFSetup/tests/test_properties.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFSetup/tests/test_properties.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -21,7 +21,7 @@
import Products
from Products.Five import zcml
from Products.CMFCore.PortalObject import PortalObjectBase
-from zope.app.tests.placelesssetup import PlacelessSetup
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from common import BaseRegistryTests
from common import DummyExportContext
Modified: CMF/trunk/CMFSetup/tests/test_typeinfo.py
===================================================================
--- CMF/trunk/CMFSetup/tests/test_typeinfo.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFSetup/tests/test_typeinfo.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -23,11 +23,11 @@
import Products
from OFS.Folder import Folder
from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
from Products.CMFCore.permissions import View
from Products.CMFCore.permissions import AccessContentsInformation
from Products.CMFCore.permissions import ModifyPortalContent
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from Products.CMFCore.TypesTool import FactoryTypeInformation
from Products.CMFCore.TypesTool import ScriptableTypeInformation
from Products.CMFCore.TypesTool import TypesTool
Modified: CMF/trunk/CMFTopic/tests/test_DateC.py
===================================================================
--- CMF/trunk/CMFTopic/tests/test_DateC.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/CMFTopic/tests/test_DateC.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -22,9 +22,7 @@
import Products
from DateTime.DateTime import DateTime
-from Products.Five import zcml
-from zope.app.tests.placelesssetup import PlacelessSetup
-
+from Products.CMFCore.tests.base.testcase import PlacelessSetup
from Products.CMFCore.tests.base.testcase import RequestTest
from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFTopic.Topic import Topic
@@ -160,6 +158,10 @@
day_diffs.extend(selectable_diffs)
def setUp(self):
+ import Products.CMFCore
+ import Products.Five
+ from Products.Five import zcml
+ import Products.GenericSetup
PlacelessSetup.setUp(self)
RequestTest.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
Modified: CMF/trunk/GenericSetup/MailHost/tests/test_exportimport.py
===================================================================
--- CMF/trunk/GenericSetup/MailHost/tests/test_exportimport.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/GenericSetup/MailHost/tests/test_exportimport.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -18,13 +18,9 @@
import unittest
import Testing
-import Products.Five
-import Products.GenericSetup.MailHost
-from Products.Five import zcml
from Products.GenericSetup.testing import NodeAdapterTestCase
-from zope.app.tests.placelesssetup import PlacelessSetup
+from Products.GenericSetup.testing import PlacelessSetup
-
_MAILHOST_XML = """\
<object name="foo_mailhost" meta_type="Mail Host" smtp_host="localhost"
smtp_port="25" smtp_pwd="" smtp_uid=""/>
@@ -40,6 +36,9 @@
return MailHostNodeAdapter
def setUp(self):
+ import Products.Five
+ from Products.Five import zcml
+ import Products.GenericSetup.MailHost
from Products.MailHost.MailHost import MailHost
PlacelessSetup.setUp(self)
Modified: CMF/trunk/GenericSetup/PluginIndexes/tests/test_exportimport.py
===================================================================
--- CMF/trunk/GenericSetup/PluginIndexes/tests/test_exportimport.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/GenericSetup/PluginIndexes/tests/test_exportimport.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -22,7 +22,7 @@
import Products.GenericSetup.PluginIndexes
from Products.Five import zcml
from Products.GenericSetup.testing import NodeAdapterTestCase
-from zope.app.tests.placelesssetup import PlacelessSetup
+from Products.GenericSetup.testing import PlacelessSetup
_DATE_XML = """\
Modified: CMF/trunk/GenericSetup/ZCTextIndex/tests/test_exportimport.py
===================================================================
--- CMF/trunk/GenericSetup/ZCTextIndex/tests/test_exportimport.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/GenericSetup/ZCTextIndex/tests/test_exportimport.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -24,7 +24,7 @@
import Products.GenericSetup.ZCTextIndex
from Products.Five import zcml
from Products.GenericSetup.testing import NodeAdapterTestCase
-from zope.app.tests.placelesssetup import PlacelessSetup
+from Products.GenericSetup.testing import PlacelessSetup
class _extra:
Modified: CMF/trunk/GenericSetup/ZCatalog/tests/test_exportimport.py
===================================================================
--- CMF/trunk/GenericSetup/ZCatalog/tests/test_exportimport.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/GenericSetup/ZCatalog/tests/test_exportimport.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -24,8 +24,8 @@
from Products.Five import zcml
from Products.GenericSetup.interfaces import INodeExporter
from Products.GenericSetup.testing import NodeAdapterTestCase
+from Products.GenericSetup.testing import PlacelessSetup
from Products.GenericSetup.utils import PrettyDocument
-from zope.app.tests.placelesssetup import PlacelessSetup
class _extra:
Modified: CMF/trunk/GenericSetup/testing.py
===================================================================
--- CMF/trunk/GenericSetup/testing.py 2005-11-07 18:19:30 UTC (rev 39962)
+++ CMF/trunk/GenericSetup/testing.py 2005-11-07 19:06:45 UTC (rev 39963)
@@ -24,7 +24,12 @@
from interfaces import INodeImporter
from utils import PrettyDocument
+try:
+ from zope.app.testing.placelesssetup import PlacelessSetup
+except ImportError: # BBB, Zope3 < 3.1
+ from zope.app.tests.placelesssetup import PlacelessSetup
+
class NodeAdapterTestCase(unittest.TestCase):
def _populate(self, obj):
More information about the CMF-checkins
mailing list