- restore Zope 2.9 compatibility, exportimport is an extra
git-svn-id: http://svn.dataflake.org/svn/Products.LDAPMultiPlugins/trunk@1798 835909ba-7c00-0410-bfa4-884f43845301
This commit is contained in:
parent
4883c33691
commit
c878cf44ae
|
@ -4,18 +4,24 @@
|
|||
i18n_domain="ldapmultiplugins"
|
||||
>
|
||||
|
||||
<adapter factory=".exportimport.LDAPMultiPluginXMLAdapter"/>
|
||||
<!-- Only install GenericSetup handlers if GenericSetup is installed -->
|
||||
<configure
|
||||
zcml:condition="installed Products.GenericSetup">
|
||||
|
||||
<genericsetup:importStep
|
||||
name="ldapmultiplugins"
|
||||
title="LDAPMultiPlugins"
|
||||
description="Import LDAPMultiPlugins settings"
|
||||
handler="Products.LDAPMultiPlugins.exportimport.importLDAPMultiPlugins"/>
|
||||
<adapter factory=".exportimport.LDAPMultiPluginXMLAdapter"/>
|
||||
|
||||
<genericsetup:exportStep
|
||||
name="ldapmultiplugins"
|
||||
title="LDAPMultiPlugins"
|
||||
description="Export LDAPMultiPlugins settings"
|
||||
handler="Products.LDAPMultiPlugins.exportimport.exportLDAPMultiPlugins"/>
|
||||
<genericsetup:importStep
|
||||
name="ldapmultiplugins"
|
||||
title="LDAPMultiPlugins"
|
||||
description="Import LDAPMultiPlugins settings"
|
||||
handler="Products.LDAPMultiPlugins.exportimport.importLDAPMultiPlugins"/>
|
||||
|
||||
<genericsetup:exportStep
|
||||
name="ldapmultiplugins"
|
||||
title="LDAPMultiPlugins"
|
||||
description="Export LDAPMultiPlugins settings"
|
||||
handler="Products.LDAPMultiPlugins.exportimport.exportLDAPMultiPlugins"/>
|
||||
|
||||
</configure>
|
||||
|
||||
</configure>
|
||||
|
|
|
@ -15,49 +15,54 @@
|
|||
$Id$
|
||||
"""
|
||||
|
||||
import unittest
|
||||
|
||||
from OFS.Folder import Folder
|
||||
from Products.Five import zcml
|
||||
|
||||
from Products.GenericSetup.testing import BodyAdapterTestCase
|
||||
from Products.GenericSetup.testing import ExportImportZCMLLayer
|
||||
from Products.GenericSetup.tests.common import BaseRegistryTests
|
||||
|
||||
|
||||
class LMPXMLAdapterTestsBase(BodyAdapterTestCase):
|
||||
|
||||
layer = ExportImportZCMLLayer
|
||||
|
||||
def _getTargetClass(self):
|
||||
from Products.LDAPMultiPlugins.exportimport \
|
||||
import LDAPMultiPluginXMLAdapter
|
||||
|
||||
return LDAPMultiPluginXMLAdapter
|
||||
|
||||
def setUp(self):
|
||||
import Products.LDAPMultiPlugins
|
||||
import Products.LDAPUserFolder
|
||||
BodyAdapterTestCase.setUp(self)
|
||||
try:
|
||||
import Products.CMFCore
|
||||
zcml.load_config('meta.zcml', Products.CMFCore)
|
||||
except ImportError:
|
||||
pass
|
||||
zcml.load_config('configure.zcml', Products.LDAPUserFolder)
|
||||
zcml.load_config('configure.zcml', Products.LDAPMultiPlugins)
|
||||
|
||||
|
||||
class _LDAPMultiPluginsSetup(BaseRegistryTests):
|
||||
|
||||
layer = ExportImportZCMLLayer
|
||||
|
||||
def _initSite(self, use_changed=False):
|
||||
self.root.site = Folder(id='site')
|
||||
site = self.root.site
|
||||
site._setObject('tested',self._getTargetClass()('tested'))
|
||||
|
||||
if use_changed:
|
||||
self._edit()
|
||||
|
||||
return site
|
||||
try:
|
||||
from Products.GenericSetup.testing import BodyAdapterTestCase
|
||||
from Products.GenericSetup.testing import ExportImportZCMLLayer
|
||||
from Products.GenericSetup.tests.common import BaseRegistryTests
|
||||
|
||||
|
||||
class LMPXMLAdapterTestsBase(BodyAdapterTestCase):
|
||||
|
||||
layer = ExportImportZCMLLayer
|
||||
|
||||
def _getTargetClass(self):
|
||||
from Products.LDAPMultiPlugins.exportimport \
|
||||
import LDAPMultiPluginXMLAdapter
|
||||
|
||||
return LDAPMultiPluginXMLAdapter
|
||||
|
||||
def setUp(self):
|
||||
import Products.LDAPMultiPlugins
|
||||
import Products.LDAPUserFolder
|
||||
BodyAdapterTestCase.setUp(self)
|
||||
try:
|
||||
import Products.CMFCore
|
||||
zcml.load_config('meta.zcml', Products.CMFCore)
|
||||
except ImportError:
|
||||
pass
|
||||
zcml.load_config('configure.zcml', Products.LDAPUserFolder)
|
||||
zcml.load_config('configure.zcml', Products.LDAPMultiPlugins)
|
||||
|
||||
|
||||
class _LDAPMultiPluginsSetup(BaseRegistryTests):
|
||||
|
||||
layer = ExportImportZCMLLayer
|
||||
|
||||
def _initSite(self, use_changed=False):
|
||||
self.root.site = Folder(id='site')
|
||||
site = self.root.site
|
||||
site._setObject('tested',self._getTargetClass()('tested'))
|
||||
|
||||
if use_changed:
|
||||
self._edit()
|
||||
|
||||
return site
|
||||
except ImportError:
|
||||
LMPXMLAdapterTestsBase = _LDAPMultiPluginsSetup = unittest.TestCase
|
||||
|
||||
|
||||
|
|
|
@ -17,8 +17,23 @@ $Id$
|
|||
|
||||
import unittest
|
||||
|
||||
from Products.GenericSetup.tests.common import DummyExportContext
|
||||
from Products.GenericSetup.tests.common import DummyImportContext
|
||||
try:
|
||||
from Products.GenericSetup.tests.common import DummyExportContext
|
||||
from Products.GenericSetup.tests.common import DummyImportContext
|
||||
|
||||
def test_suite():
|
||||
return unittest.TestSuite((
|
||||
unittest.makeSuite(LDAPMultiPluginXMLAdapterTests),
|
||||
unittest.makeSuite(ActiveDirectoryMultiPluginXMLAdapterTests),
|
||||
unittest.makeSuite(LDAPMultiPluginExportTests),
|
||||
unittest.makeSuite(ADMultiPluginExportTests),
|
||||
unittest.makeSuite(LDAPMultiPluginImportTests),
|
||||
unittest.makeSuite(ADMultiPluginImportTests),
|
||||
))
|
||||
|
||||
except ImportError:
|
||||
def test_suite():
|
||||
return unittest.TestSuite()
|
||||
|
||||
from Products.LDAPMultiPlugins.tests.base import _LDAPMultiPluginsSetup
|
||||
from Products.LDAPMultiPlugins.tests.base import LMPXMLAdapterTestsBase
|
||||
|
@ -176,16 +191,6 @@ class ADMultiPluginImportTests(_LDAPMultiPluginsSetup):
|
|||
self.assertEquals(plugin.group_recurse_depth, 0)
|
||||
|
||||
|
||||
def test_suite():
|
||||
return unittest.TestSuite((
|
||||
unittest.makeSuite(LDAPMultiPluginXMLAdapterTests),
|
||||
unittest.makeSuite(ActiveDirectoryMultiPluginXMLAdapterTests),
|
||||
unittest.makeSuite(LDAPMultiPluginExportTests),
|
||||
unittest.makeSuite(ADMultiPluginExportTests),
|
||||
unittest.makeSuite(LDAPMultiPluginImportTests),
|
||||
unittest.makeSuite(ADMultiPluginImportTests),
|
||||
))
|
||||
|
||||
|
||||
_LDAPMULTIPLUGIN_BODY = """\
|
||||
<?xml version="1.0"?>
|
||||
|
|
9
setup.py
9
setup.py
|
@ -41,12 +41,17 @@ setup(name='Products.%s' % NAME,
|
|||
namespace_packages=['Products'],
|
||||
zip_safe=False,
|
||||
install_requires=[
|
||||
#"Zope >= 2.9",
|
||||
#Zope >= 2.9,
|
||||
"setuptools",
|
||||
"Products.LDAPUserFolder >= 2.9",
|
||||
"Products.PluggableAuthService >= 1.4.0",
|
||||
"Products.GenericSetup >= 1.4.0",
|
||||
],
|
||||
extras_require={
|
||||
'exportimport': [
|
||||
# Zope >= 2.10.0
|
||||
'Products.GenericSetup >= 1.4.0'
|
||||
]
|
||||
},
|
||||
entry_points="""
|
||||
[zope2.initialize]
|
||||
Products.LDAPMultiPlugins = Products.LDAPMultiPlugins:initialize
|
||||
|
|
Reference in New Issue