From 23a15a58179a0f766f799c0a1efdb48307138f3d Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 30 Oct 2020 09:35:01 +0100 Subject: [PATCH 1/8] Fix sort order of imports to match isort's rules. --- .../PluggableAuthService/PluggableAuthService.py | 5 ++--- Products/PluggableAuthService/__init__.py | 3 +-- Products/PluggableAuthService/exportimport.py | 3 +-- .../PluggableAuthService/plugins/exportimport.py | 5 ++--- .../plugins/tests/test_exportimport.py | 1 + .../PluggableAuthService/tests/test_Caching.py | 1 - .../tests/test_exportimport.py | 15 +++++++++------ 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Products/PluggableAuthService/PluggableAuthService.py b/Products/PluggableAuthService/PluggableAuthService.py index f572fd3..9819566 100644 --- a/Products/PluggableAuthService/PluggableAuthService.py +++ b/Products/PluggableAuthService/PluggableAuthService.py @@ -35,14 +35,13 @@ from OFS.interfaces import IObjectManager from OFS.interfaces import IPropertyManager from Products.PageTemplates.PageTemplateFile import PageTemplateFile +from Products.PluginRegistry.PluginRegistry import PluginRegistry +from Products.StandardCacheManagers.RAMCacheManager import RAMCacheManager from zExceptions import Unauthorized from zope.event import notify from ZPublisher import BeforeTraverse from ZTUtils import Batch -from Products.PluginRegistry.PluginRegistry import PluginRegistry -from Products.StandardCacheManagers.RAMCacheManager import RAMCacheManager - from .events import PrincipalCreated from .interfaces.authservice import IPluggableAuthService from .interfaces.authservice import _noroles diff --git a/Products/PluggableAuthService/__init__.py b/Products/PluggableAuthService/__init__.py index bcace40..e515eb2 100644 --- a/Products/PluggableAuthService/__init__.py +++ b/Products/PluggableAuthService/__init__.py @@ -23,11 +23,10 @@ from AccessControl.Permissions import manage_users as ManageUsers from App.Management import Navigation -from zExceptions import Unauthorized - from Products.GenericSetup import BASE from Products.GenericSetup import profile_registry from Products.GenericSetup.tool import SetupTool +from zExceptions import Unauthorized from . import PluggableAuthService from .interfaces.authservice import IPluggableAuthService diff --git a/Products/PluggableAuthService/exportimport.py b/Products/PluggableAuthService/exportimport.py index d7f4994..bd7b0d5 100644 --- a/Products/PluggableAuthService/exportimport.py +++ b/Products/PluggableAuthService/exportimport.py @@ -13,12 +13,11 @@ """Filesystem exporter / importer adapters. """ -from zope.interface import implementer - from Products.GenericSetup.interfaces import IContentFactory from Products.GenericSetup.interfaces import IContentFactoryName from Products.GenericSetup.interfaces import IFilesystemExporter from Products.GenericSetup.interfaces import IFilesystemImporter +from zope.interface import implementer def exportPAS(context): diff --git a/Products/PluggableAuthService/plugins/exportimport.py b/Products/PluggableAuthService/plugins/exportimport.py index 89f452e..7461448 100644 --- a/Products/PluggableAuthService/plugins/exportimport.py +++ b/Products/PluggableAuthService/plugins/exportimport.py @@ -21,13 +21,12 @@ import six from Acquisition import Implicit -from Products.PageTemplates.PageTemplateFile import PageTemplateFile -from zope.interface import implementer - from Products.GenericSetup.content import DAVAwareFileAdapter from Products.GenericSetup.content import FolderishExporterImporter from Products.GenericSetup.interfaces import IFilesystemExporter from Products.GenericSetup.interfaces import IFilesystemImporter +from Products.PageTemplates.PageTemplateFile import PageTemplateFile +from zope.interface import implementer def getPackagePath(instance): diff --git a/Products/PluggableAuthService/plugins/tests/test_exportimport.py b/Products/PluggableAuthService/plugins/tests/test_exportimport.py index a4d7db2..3f9dca9 100644 --- a/Products/PluggableAuthService/plugins/tests/test_exportimport.py +++ b/Products/PluggableAuthService/plugins/tests/test_exportimport.py @@ -23,6 +23,7 @@ ConformsToIFilesystemExporter from Products.GenericSetup.tests.conformance import \ ConformsToIFilesystemImporter + from Products.PluggableAuthService.tests.utils import _setUpDefaultTraversable diff --git a/Products/PluggableAuthService/tests/test_Caching.py b/Products/PluggableAuthService/tests/test_Caching.py index b347dc0..608b618 100644 --- a/Products/PluggableAuthService/tests/test_Caching.py +++ b/Products/PluggableAuthService/tests/test_Caching.py @@ -15,7 +15,6 @@ from Acquisition import aq_base from OFS.Cache import isCacheable - from Products.StandardCacheManagers.RAMCacheManager import RAMCacheManager diff --git a/Products/PluggableAuthService/tests/test_exportimport.py b/Products/PluggableAuthService/tests/test_exportimport.py index 4dfd722..da6f060 100644 --- a/Products/PluggableAuthService/tests/test_exportimport.py +++ b/Products/PluggableAuthService/tests/test_exportimport.py @@ -17,9 +17,9 @@ from six import StringIO +from Products.GenericSetup.tests.common import BaseRegistryTests from zope.component.testing import PlacelessSetup -from Products.GenericSetup.tests.common import BaseRegistryTests from Products.PluggableAuthService.tests.utils import _setUpDefaultTraversable @@ -45,8 +45,6 @@ class Test_exportPAS(_TestBase): def _setUpAdapters(self): from OFS.interfaces import IObjectManager from OFS.interfaces import IPropertyManager - from zope.component import provideAdapter - from Products.GenericSetup.content import CSVAwareFileAdapter from Products.GenericSetup.content import DAVAwareFileAdapter from Products.GenericSetup.content import FolderishExporterImporter @@ -57,10 +55,12 @@ def _setUpAdapters(self): from Products.GenericSetup.interfaces import IDAVAware from Products.GenericSetup.interfaces import IFilesystemExporter from Products.GenericSetup.interfaces import IINIAware - from Products.PluggableAuthService.exportimport import PAS_CF_Namer from Products.PluginRegistry.exportimport import \ PluginRegistryFileExportImportAdapter from Products.PluginRegistry.interfaces import IPluginRegistry + from zope.component import provideAdapter + + from Products.PluggableAuthService.exportimport import PAS_CF_Namer provideAdapter(FolderishExporterImporter, (IObjectManager,), @@ -92,6 +92,7 @@ def _setUpAdapters(self): def test_empty(self): from Products.GenericSetup.tests.common import DummyExportContext + from Products.PluggableAuthService.exportimport import exportPAS _setUpDefaultTraversable() @@ -126,6 +127,7 @@ def test_with_contents(self): from Products.GenericSetup.tests.common import DummyExportContext from Products.GenericSetup.tests.faux_objects import TestCSVAware from Products.GenericSetup.utils import _getDottedName + from Products.PluggableAuthService.exportimport import exportPAS _setUpDefaultTraversable() @@ -178,8 +180,6 @@ class Test_importPAS(_TestBase): def _setUpAdapters(self): from OFS.interfaces import IObjectManager from OFS.interfaces import IPropertyManager - from zope.component import provideAdapter - from Products.GenericSetup.content import CSVAwareFileAdapter from Products.GenericSetup.content import DAVAwareFileAdapter from Products.GenericSetup.content import FolderishExporterImporter @@ -193,6 +193,7 @@ def _setUpAdapters(self): from Products.PluginRegistry.exportimport import \ PluginRegistryFileExportImportAdapter from Products.PluginRegistry.interfaces import IPluginRegistry + from zope.component import provideAdapter from ..exportimport import PAS_PR_ContentFactory from ..interfaces.authservice import IPluggableAuthService @@ -228,6 +229,7 @@ def _setUpAdapters(self): def test_empty_modifying_plugin_types(self): from Products.GenericSetup.tests.common import DummyImportContext + from Products.PluggableAuthService.exportimport import importPAS self._setUpAdapters() @@ -246,6 +248,7 @@ def test_empty_adding_plugins(self): from Products.GenericSetup.tests.common import DummyImportContext from Products.GenericSetup.tests.faux_objects import KNOWN_CSV from Products.GenericSetup.tests.faux_objects import TestCSVAware + from Products.PluggableAuthService.exportimport import importPAS self._setUpAdapters() From 8fd83e4e9fc098e7a482094e6b9bbf8ee1369312 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 30 Oct 2020 09:48:11 +0100 Subject: [PATCH 2/8] - Products.PluggableAuthService is local, not first party --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 26d54cd..5beda13 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,7 @@ ignore = force_single_line = True combine_as_imports = True sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER -known_first_party = Products.PluggableAuthService +known_local_folder = Products.PluggableAuthService known_third_party = six known_zope = Products.PageTemplates default_section = ZOPE From a72fe3e3ef4db55a0001a78d08479d8586f1e1c5 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 30 Oct 2020 09:50:28 +0100 Subject: [PATCH 3/8] - apply isort config --- .../PluggableAuthService/UserPropertySheet.py | 3 +-- .../plugins/ScriptablePlugin.py | 1 + .../plugins/tests/test_InlineAuthHelper.py | 9 ++++----- .../tests/test_PluggableAuthService.py | 15 +++++---------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Products/PluggableAuthService/UserPropertySheet.py b/Products/PluggableAuthService/UserPropertySheet.py index fc2147d..bfb3238 100644 --- a/Products/PluggableAuthService/UserPropertySheet.py +++ b/Products/PluggableAuthService/UserPropertySheet.py @@ -19,9 +19,8 @@ from DateTime.DateTime import DateTime from OFS.Image import Image -from Products.PluggableAuthService.utils import classImplements - from .interfaces.propertysheets import IPropertySheet +from Products.PluggableAuthService.utils import classImplements StringTypes = (str, six.text_type) diff --git a/Products/PluggableAuthService/plugins/ScriptablePlugin.py b/Products/PluggableAuthService/plugins/ScriptablePlugin.py index 6ecd5db..f0fd42c 100644 --- a/Products/PluggableAuthService/plugins/ScriptablePlugin.py +++ b/Products/PluggableAuthService/plugins/ScriptablePlugin.py @@ -24,6 +24,7 @@ from zope.interface import providedBy import Products + from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin from Products.PluggableAuthService.utils import classImplements from Products.PluggableAuthService.utils import directlyProvides diff --git a/Products/PluggableAuthService/plugins/tests/test_InlineAuthHelper.py b/Products/PluggableAuthService/plugins/tests/test_InlineAuthHelper.py index d8ec50f..066c3b5 100644 --- a/Products/PluggableAuthService/plugins/tests/test_InlineAuthHelper.py +++ b/Products/PluggableAuthService/plugins/tests/test_InlineAuthHelper.py @@ -13,16 +13,15 @@ ############################################################################## import unittest -from Products.PluggableAuthService.tests.conformance import \ - IChallengePlugin_conformance -from Products.PluggableAuthService.tests.conformance import \ - ILoginPasswordHostExtractionPlugin_conformance - from ...tests.test_PluggableAuthService import FauxContainer from ...tests.test_PluggableAuthService import FauxObject from ...tests.test_PluggableAuthService import FauxRequest from ...tests.test_PluggableAuthService import FauxResponse from ...tests.test_PluggableAuthService import FauxRoot +from Products.PluggableAuthService.tests.conformance import \ + IChallengePlugin_conformance +from Products.PluggableAuthService.tests.conformance import \ + ILoginPasswordHostExtractionPlugin_conformance class FauxSettableRequest(FauxRequest): diff --git a/Products/PluggableAuthService/tests/test_PluggableAuthService.py b/Products/PluggableAuthService/tests/test_PluggableAuthService.py index e2e0f4c..733c57f 100644 --- a/Products/PluggableAuthService/tests/test_PluggableAuthService.py +++ b/Products/PluggableAuthService/tests/test_PluggableAuthService.py @@ -25,10 +25,9 @@ from zExceptions import Unauthorized from zope.interface import implementer -from Products.PluggableAuthService.utils import directlyProvides - from ..interfaces.plugins import INotCompetentPlugin from .conformance import IUserFolder_conformance +from Products.PluggableAuthService.utils import directlyProvides class DummyPlugin(Implicit): @@ -756,9 +755,8 @@ def test__extractUserIds_authenticate_emergency_user_broken_extor(self): from AccessControl.users import UnrestrictedUser - from Products.PluggableAuthService import PluggableAuthService - from ..interfaces.plugins import IExtractionPlugin + from Products.PluggableAuthService import PluggableAuthService old_eu = PluggableAuthService.emergency_user @@ -862,10 +860,9 @@ def test__extractUserIds_authenticate_emrgncy_with_broken_authicator(self): from AccessControl.users import UnrestrictedUser - from Products.PluggableAuthService import PluggableAuthService - from ..interfaces.plugins import IAuthenticationPlugin from ..interfaces.plugins import IExtractionPlugin + from Products.PluggableAuthService import PluggableAuthService old_eu = PluggableAuthService.emergency_user @@ -913,10 +910,9 @@ def test__extractUserIds_emergency_user_always_wins(self): from AccessControl.users import UnrestrictedUser - from Products.PluggableAuthService import PluggableAuthService - from ..interfaces.plugins import IAuthenticationPlugin from ..interfaces.plugins import IExtractionPlugin + from Products.PluggableAuthService import PluggableAuthService old_eu = PluggableAuthService.emergency_user @@ -987,10 +983,9 @@ def test__extractUserIds_emergency_user_always_wins_in_transform(self): from AccessControl.users import UnrestrictedUser - from Products.PluggableAuthService import PluggableAuthService - from ..interfaces.plugins import IAuthenticationPlugin from ..interfaces.plugins import IExtractionPlugin + from Products.PluggableAuthService import PluggableAuthService old_eu = PluggableAuthService.emergency_user From bd8fad3c595e81734253b8819090a9fa8220aca7 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 30 Oct 2020 09:55:07 +0100 Subject: [PATCH 4/8] - define suitable first party packages --- Products/PluggableAuthService/PluggableAuthService.py | 5 +++-- Products/PluggableAuthService/__init__.py | 3 ++- Products/PluggableAuthService/exportimport.py | 3 ++- Products/PluggableAuthService/plugins/exportimport.py | 5 +++-- Products/PluggableAuthService/tests/test_Caching.py | 1 + Products/PluggableAuthService/tests/test_exportimport.py | 9 ++++++--- setup.cfg | 3 ++- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Products/PluggableAuthService/PluggableAuthService.py b/Products/PluggableAuthService/PluggableAuthService.py index 9819566..f572fd3 100644 --- a/Products/PluggableAuthService/PluggableAuthService.py +++ b/Products/PluggableAuthService/PluggableAuthService.py @@ -35,13 +35,14 @@ from OFS.interfaces import IObjectManager from OFS.interfaces import IPropertyManager from Products.PageTemplates.PageTemplateFile import PageTemplateFile -from Products.PluginRegistry.PluginRegistry import PluginRegistry -from Products.StandardCacheManagers.RAMCacheManager import RAMCacheManager from zExceptions import Unauthorized from zope.event import notify from ZPublisher import BeforeTraverse from ZTUtils import Batch +from Products.PluginRegistry.PluginRegistry import PluginRegistry +from Products.StandardCacheManagers.RAMCacheManager import RAMCacheManager + from .events import PrincipalCreated from .interfaces.authservice import IPluggableAuthService from .interfaces.authservice import _noroles diff --git a/Products/PluggableAuthService/__init__.py b/Products/PluggableAuthService/__init__.py index e515eb2..bcace40 100644 --- a/Products/PluggableAuthService/__init__.py +++ b/Products/PluggableAuthService/__init__.py @@ -23,10 +23,11 @@ from AccessControl.Permissions import manage_users as ManageUsers from App.Management import Navigation +from zExceptions import Unauthorized + from Products.GenericSetup import BASE from Products.GenericSetup import profile_registry from Products.GenericSetup.tool import SetupTool -from zExceptions import Unauthorized from . import PluggableAuthService from .interfaces.authservice import IPluggableAuthService diff --git a/Products/PluggableAuthService/exportimport.py b/Products/PluggableAuthService/exportimport.py index bd7b0d5..d7f4994 100644 --- a/Products/PluggableAuthService/exportimport.py +++ b/Products/PluggableAuthService/exportimport.py @@ -13,11 +13,12 @@ """Filesystem exporter / importer adapters. """ +from zope.interface import implementer + from Products.GenericSetup.interfaces import IContentFactory from Products.GenericSetup.interfaces import IContentFactoryName from Products.GenericSetup.interfaces import IFilesystemExporter from Products.GenericSetup.interfaces import IFilesystemImporter -from zope.interface import implementer def exportPAS(context): diff --git a/Products/PluggableAuthService/plugins/exportimport.py b/Products/PluggableAuthService/plugins/exportimport.py index 7461448..89f452e 100644 --- a/Products/PluggableAuthService/plugins/exportimport.py +++ b/Products/PluggableAuthService/plugins/exportimport.py @@ -21,12 +21,13 @@ import six from Acquisition import Implicit +from Products.PageTemplates.PageTemplateFile import PageTemplateFile +from zope.interface import implementer + from Products.GenericSetup.content import DAVAwareFileAdapter from Products.GenericSetup.content import FolderishExporterImporter from Products.GenericSetup.interfaces import IFilesystemExporter from Products.GenericSetup.interfaces import IFilesystemImporter -from Products.PageTemplates.PageTemplateFile import PageTemplateFile -from zope.interface import implementer def getPackagePath(instance): diff --git a/Products/PluggableAuthService/tests/test_Caching.py b/Products/PluggableAuthService/tests/test_Caching.py index 608b618..b347dc0 100644 --- a/Products/PluggableAuthService/tests/test_Caching.py +++ b/Products/PluggableAuthService/tests/test_Caching.py @@ -15,6 +15,7 @@ from Acquisition import aq_base from OFS.Cache import isCacheable + from Products.StandardCacheManagers.RAMCacheManager import RAMCacheManager diff --git a/Products/PluggableAuthService/tests/test_exportimport.py b/Products/PluggableAuthService/tests/test_exportimport.py index da6f060..faf77e6 100644 --- a/Products/PluggableAuthService/tests/test_exportimport.py +++ b/Products/PluggableAuthService/tests/test_exportimport.py @@ -17,9 +17,10 @@ from six import StringIO -from Products.GenericSetup.tests.common import BaseRegistryTests from zope.component.testing import PlacelessSetup +from Products.GenericSetup.tests.common import BaseRegistryTests + from Products.PluggableAuthService.tests.utils import _setUpDefaultTraversable @@ -45,6 +46,8 @@ class Test_exportPAS(_TestBase): def _setUpAdapters(self): from OFS.interfaces import IObjectManager from OFS.interfaces import IPropertyManager + from zope.component import provideAdapter + from Products.GenericSetup.content import CSVAwareFileAdapter from Products.GenericSetup.content import DAVAwareFileAdapter from Products.GenericSetup.content import FolderishExporterImporter @@ -58,7 +61,6 @@ def _setUpAdapters(self): from Products.PluginRegistry.exportimport import \ PluginRegistryFileExportImportAdapter from Products.PluginRegistry.interfaces import IPluginRegistry - from zope.component import provideAdapter from Products.PluggableAuthService.exportimport import PAS_CF_Namer @@ -180,6 +182,8 @@ class Test_importPAS(_TestBase): def _setUpAdapters(self): from OFS.interfaces import IObjectManager from OFS.interfaces import IPropertyManager + from zope.component import provideAdapter + from Products.GenericSetup.content import CSVAwareFileAdapter from Products.GenericSetup.content import DAVAwareFileAdapter from Products.GenericSetup.content import FolderishExporterImporter @@ -193,7 +197,6 @@ def _setUpAdapters(self): from Products.PluginRegistry.exportimport import \ PluginRegistryFileExportImportAdapter from Products.PluginRegistry.interfaces import IPluginRegistry - from zope.component import provideAdapter from ..exportimport import PAS_PR_ContentFactory from ..interfaces.authservice import IPluggableAuthService diff --git a/setup.cfg b/setup.cfg index 5beda13..83d510f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,8 +15,9 @@ force_single_line = True combine_as_imports = True sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER known_local_folder = Products.PluggableAuthService +known_first_party = Products.PluginRegistry, Products.StandardCacheManagers, Products.GenericSetup known_third_party = six -known_zope = Products.PageTemplates +known_zope = default_section = ZOPE line_length = 79 lines_after_imports = 2 From f7f2b8c4aa29bbe5bdf31e16c02cc7c1312b523f Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 30 Oct 2020 10:01:43 +0100 Subject: [PATCH 5/8] Fix DeprecationWarnings occurring on Zope 5. --- CHANGES.rst | 2 +- Products/PluggableAuthService/PropertiedUser.py | 2 +- .../PluggableAuthService/plugins/NotCompetentHelper.py | 2 +- Products/PluggableAuthService/plugins/ZODBUserManager.py | 2 +- .../plugins/tests/test_ZODBUserManager.py | 8 ++++---- Products/PluggableAuthService/tests/test_UserFolder.py | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 7f745d1..d71a51a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ Change Log 2.5.1 (unreleased) ------------------ -- Nothing changed yet. +- Fix DeprecationWarnings occurring on Zope 5. 2.5 (2020-10-12) diff --git a/Products/PluggableAuthService/PropertiedUser.py b/Products/PluggableAuthService/PropertiedUser.py index 83574c2..4e61b28 100644 --- a/Products/PluggableAuthService/PropertiedUser.py +++ b/Products/PluggableAuthService/PropertiedUser.py @@ -15,7 +15,7 @@ """ from AccessControl.PermissionRole import _what_not_even_god_should_do -from AccessControl.User import BasicUser +from AccessControl.users import BasicUser from Acquisition import aq_inner from Acquisition import aq_parent diff --git a/Products/PluggableAuthService/plugins/NotCompetentHelper.py b/Products/PluggableAuthService/plugins/NotCompetentHelper.py index 8aab430..b97a9c9 100644 --- a/Products/PluggableAuthService/plugins/NotCompetentHelper.py +++ b/Products/PluggableAuthService/plugins/NotCompetentHelper.py @@ -23,7 +23,7 @@ from AccessControl import ClassSecurityInfo from AccessControl.Permissions import manage_users -from AccessControl.User import nobody +from AccessControl.users import nobody from Acquisition import aq_base from Acquisition import aq_inner from Acquisition import aq_parent diff --git a/Products/PluggableAuthService/plugins/ZODBUserManager.py b/Products/PluggableAuthService/plugins/ZODBUserManager.py index d098496..65ff736 100644 --- a/Products/PluggableAuthService/plugins/ZODBUserManager.py +++ b/Products/PluggableAuthService/plugins/ZODBUserManager.py @@ -18,11 +18,11 @@ import six -from AccessControl import AuthEncoding from AccessControl import ClassSecurityInfo from AccessControl.class_init import InitializeClass from AccessControl.requestmethod import postonly from AccessControl.SecurityManagement import getSecurityManager +from AuthEncoding import AuthEncoding from BTrees.OOBTree import OOBTree from OFS.Cache import Cacheable from Products.PageTemplates.PageTemplateFile import PageTemplateFile diff --git a/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py b/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py index 1691b83..7225302 100644 --- a/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py +++ b/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py @@ -13,7 +13,7 @@ ############################################################################## import unittest -from AccessControl.AuthEncoding import pw_encrypt +from AuthEncoding.AuthEncoding import pw_encrypt from zExceptions import Forbidden from ...plugins.tests.helpers import makeRequestAndResponse @@ -521,7 +521,7 @@ def test_getUserByIdWithOptionalMangling(self): def test_addUser_with_not_yet_encrypted_password(self): # See collector #1869 && #1926 - from AccessControl.AuthEncoding import is_encrypted + from AuthEncoding.AuthEncoding import is_encrypted USER_ID = 'not_yet_encrypted' PASSWORD = 'password' @@ -538,7 +538,7 @@ def test_addUser_with_not_yet_encrypted_password(self): def test_addUser_with_preencrypted_password(self): # See collector #1869 && #1926 - from AccessControl.AuthEncoding import pw_encrypt + from AuthEncoding.AuthEncoding import pw_encrypt USER_ID = 'already_encrypted' PASSWORD = 'password' @@ -554,7 +554,7 @@ def test_addUser_with_preencrypted_password(self): self.assertEqual(uid_and_info, (USER_ID, USER_ID)) def test_updateUserPassword_with_not_yet_encrypted_password(self): - from AccessControl.AuthEncoding import is_encrypted + from AuthEncoding.AuthEncoding import is_encrypted USER_ID = 'not_yet_encrypted' PASSWORD = 'password' diff --git a/Products/PluggableAuthService/tests/test_UserFolder.py b/Products/PluggableAuthService/tests/test_UserFolder.py index 696e16d..769ae5e 100644 --- a/Products/PluggableAuthService/tests/test_UserFolder.py +++ b/Products/PluggableAuthService/tests/test_UserFolder.py @@ -224,7 +224,7 @@ def user_names(self): def test__doAddUser_with_not_yet_encrypted_passwords(self): # See collector #1869 && #1926 - from AccessControl.AuthEncoding import is_encrypted + from AuthEncoding.AuthEncoding import is_encrypted USER_ID = 'not_yet_encrypted' PASSWORD = 'password' @@ -240,7 +240,7 @@ def test__doAddUser_with_not_yet_encrypted_passwords(self): def test__doAddUser_with_preencrypted_passwords(self): # See collector #1869 && #1926 - from AccessControl.AuthEncoding import pw_encrypt + from AuthEncoding.AuthEncoding import pw_encrypt USER_ID = 'already_encrypted' PASSWORD = 'password' From ad8459087b0ced9da10916e9d5f103a39ad74920 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 30 Oct 2020 10:12:51 +0100 Subject: [PATCH 6/8] - use relative imports where possible --- .../PluggableAuthService/UserPropertySheet.py | 2 +- .../plugins/BasePlugin.py | 6 +++--- .../plugins/LocalRolePlugin.py | 6 +++--- .../plugins/RecursiveGroupsPlugin.py | 8 ++++---- .../plugins/RequestTypeSniffer.py | 2 +- .../plugins/ScriptablePlugin.py | 6 +++--- .../tests/test_ChallengeProtocolChooser.py | 2 +- .../plugins/tests/test_InlineAuthHelper.py | 6 ++---- .../plugins/tests/test_exportimport.py | 2 +- .../tests/test_Caching.py | 6 +++--- .../tests/test_MoreCaching.py | 4 ++-- .../tests/test_PluggableAuthService.py | 12 +++++------ .../tests/test_PropertiedUser.py | 2 +- .../PluggableAuthService/tests/test_events.py | 20 +++++++++---------- .../tests/test_exportimport.py | 12 +++++------ .../PluggableAuthService/tests/test_utils.py | 12 +++++------ 16 files changed, 53 insertions(+), 55 deletions(-) diff --git a/Products/PluggableAuthService/UserPropertySheet.py b/Products/PluggableAuthService/UserPropertySheet.py index bfb3238..21a8f67 100644 --- a/Products/PluggableAuthService/UserPropertySheet.py +++ b/Products/PluggableAuthService/UserPropertySheet.py @@ -20,7 +20,7 @@ from OFS.Image import Image from .interfaces.propertysheets import IPropertySheet -from Products.PluggableAuthService.utils import classImplements +from .utils import classImplements StringTypes = (str, six.text_type) diff --git a/Products/PluggableAuthService/plugins/BasePlugin.py b/Products/PluggableAuthService/plugins/BasePlugin.py index 559ed3e..7f5587a 100644 --- a/Products/PluggableAuthService/plugins/BasePlugin.py +++ b/Products/PluggableAuthService/plugins/BasePlugin.py @@ -25,9 +25,9 @@ from zope.interface import implementedBy from zope.interface import providedBy -from Products.PluggableAuthService.permissions import ManageUsers -from Products.PluggableAuthService.utils import classImplements -from Products.PluggableAuthService.utils import createViewName +from ..permissions import ManageUsers +from ..utils import classImplements +from ..utils import createViewName def flattenInterfaces(implemented): diff --git a/Products/PluggableAuthService/plugins/LocalRolePlugin.py b/Products/PluggableAuthService/plugins/LocalRolePlugin.py index a2b3a70..d0251b8 100644 --- a/Products/PluggableAuthService/plugins/LocalRolePlugin.py +++ b/Products/PluggableAuthService/plugins/LocalRolePlugin.py @@ -19,9 +19,9 @@ from Products.PageTemplates.PageTemplateFile import PageTemplateFile from zope.interface import Interface -from Products.PluggableAuthService.interfaces.plugins import IRolesPlugin -from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin -from Products.PluggableAuthService.utils import classImplements +from ..interfaces.plugins import IRolesPlugin +from ..utils import classImplements +from .BasePlugin import BasePlugin class ILocalRolePlugin(Interface): diff --git a/Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py b/Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py index dc35252..092269c 100644 --- a/Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py +++ b/Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py @@ -20,10 +20,10 @@ from Products.PageTemplates.PageTemplateFile import PageTemplateFile from zope.interface import Interface -from Products.PluggableAuthService.interfaces.plugins import IGroupsPlugin -from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin -from Products.PluggableAuthService.PropertiedUser import PropertiedUser -from Products.PluggableAuthService.utils import classImplements +from ..interfaces.plugins import IGroupsPlugin +from ..PropertiedUser import PropertiedUser +from ..utils import classImplements +from .BasePlugin import BasePlugin class IRecursiveGroupsPlugin(Interface): diff --git a/Products/PluggableAuthService/plugins/RequestTypeSniffer.py b/Products/PluggableAuthService/plugins/RequestTypeSniffer.py index 81e2e0e..744f224 100644 --- a/Products/PluggableAuthService/plugins/RequestTypeSniffer.py +++ b/Products/PluggableAuthService/plugins/RequestTypeSniffer.py @@ -32,7 +32,7 @@ if HAVE_ZSERVER: from ZServer.FTPRequest import FTPRequest - from Products.PluggableAuthService.interfaces.request import IFTPRequest + from ..interfaces.request import IFTPRequest class IRequestTypeSnifferPlugin(Interface): diff --git a/Products/PluggableAuthService/plugins/ScriptablePlugin.py b/Products/PluggableAuthService/plugins/ScriptablePlugin.py index f0fd42c..c97d540 100644 --- a/Products/PluggableAuthService/plugins/ScriptablePlugin.py +++ b/Products/PluggableAuthService/plugins/ScriptablePlugin.py @@ -25,9 +25,9 @@ import Products -from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin -from Products.PluggableAuthService.utils import classImplements -from Products.PluggableAuthService.utils import directlyProvides +from ..utils import classImplements +from ..utils import directlyProvides +from .BasePlugin import BasePlugin class IScriptablePlugin(Interface): diff --git a/Products/PluggableAuthService/plugins/tests/test_ChallengeProtocolChooser.py b/Products/PluggableAuthService/plugins/tests/test_ChallengeProtocolChooser.py index f23d1eb..e13dd9e 100644 --- a/Products/PluggableAuthService/plugins/tests/test_ChallengeProtocolChooser.py +++ b/Products/PluggableAuthService/plugins/tests/test_ChallengeProtocolChooser.py @@ -142,7 +142,7 @@ def setup_sniffer(self): def setup_user(self): # Create a user for testing: - from Products.PluggableAuthService.PropertiedUser import PropertiedUser + from ...PropertiedUser import PropertiedUser pas = self.folder.acl_users self.assertIsNone(pas.getUserById('test_user_')) diff --git a/Products/PluggableAuthService/plugins/tests/test_InlineAuthHelper.py b/Products/PluggableAuthService/plugins/tests/test_InlineAuthHelper.py index 066c3b5..f8bc643 100644 --- a/Products/PluggableAuthService/plugins/tests/test_InlineAuthHelper.py +++ b/Products/PluggableAuthService/plugins/tests/test_InlineAuthHelper.py @@ -13,15 +13,13 @@ ############################################################################## import unittest +from ...tests.conformance import IChallengePlugin_conformance +from ...tests.conformance import ILoginPasswordHostExtractionPlugin_conformance from ...tests.test_PluggableAuthService import FauxContainer from ...tests.test_PluggableAuthService import FauxObject from ...tests.test_PluggableAuthService import FauxRequest from ...tests.test_PluggableAuthService import FauxResponse from ...tests.test_PluggableAuthService import FauxRoot -from Products.PluggableAuthService.tests.conformance import \ - IChallengePlugin_conformance -from Products.PluggableAuthService.tests.conformance import \ - ILoginPasswordHostExtractionPlugin_conformance class FauxSettableRequest(FauxRequest): diff --git a/Products/PluggableAuthService/plugins/tests/test_exportimport.py b/Products/PluggableAuthService/plugins/tests/test_exportimport.py index 3f9dca9..d9e9c07 100644 --- a/Products/PluggableAuthService/plugins/tests/test_exportimport.py +++ b/Products/PluggableAuthService/plugins/tests/test_exportimport.py @@ -24,7 +24,7 @@ from Products.GenericSetup.tests.conformance import \ ConformsToIFilesystemImporter -from Products.PluggableAuthService.tests.utils import _setUpDefaultTraversable +from ...tests.utils import _setUpDefaultTraversable class _TestBase(BaseRegistryTests, ConformsToIFilesystemExporter, diff --git a/Products/PluggableAuthService/tests/test_Caching.py b/Products/PluggableAuthService/tests/test_Caching.py index b347dc0..37f844e 100644 --- a/Products/PluggableAuthService/tests/test_Caching.py +++ b/Products/PluggableAuthService/tests/test_Caching.py @@ -71,8 +71,8 @@ def _makePlugins(self, plugin_type_info=None): def _makeAndFill(self): - from Products.PluggableAuthService.plugins import ZODBRoleManager - from Products.PluggableAuthService.plugins import ZODBUserManager + from ..plugins import ZODBRoleManager + from ..plugins import ZODBUserManager plugin_registry = self._makePlugins() user_source = ZODBUserManager.ZODBUserManager('zodb_users') @@ -115,7 +115,7 @@ def test_caching_in_PAS(self): # First, we register the ZODBUserManager as a plugin suitable # for storing and returning user objects and the ZODBRoleManager # for roles. Basic scaffolding to be able to store and retrieve users. - from Products.PluggableAuthService.interfaces import plugins + from ..interfaces import plugins plugin_registry.activatePlugin(plugins.IUserEnumerationPlugin, user_source.getId()) diff --git a/Products/PluggableAuthService/tests/test_MoreCaching.py b/Products/PluggableAuthService/tests/test_MoreCaching.py index 68033a8..5242b1b 100644 --- a/Products/PluggableAuthService/tests/test_MoreCaching.py +++ b/Products/PluggableAuthService/tests/test_MoreCaching.py @@ -14,8 +14,8 @@ from AccessControl.Permissions import view as View -from Products.PluggableAuthService.interfaces.plugins import IExtractionPlugin -from Products.PluggableAuthService.tests import pastc +from ..interfaces.plugins import IExtractionPlugin +from . import pastc class CachingTests(pastc.PASTestCase): diff --git a/Products/PluggableAuthService/tests/test_PluggableAuthService.py b/Products/PluggableAuthService/tests/test_PluggableAuthService.py index 733c57f..a947d71 100644 --- a/Products/PluggableAuthService/tests/test_PluggableAuthService.py +++ b/Products/PluggableAuthService/tests/test_PluggableAuthService.py @@ -26,8 +26,8 @@ from zope.interface import implementer from ..interfaces.plugins import INotCompetentPlugin +from ..utils import directlyProvides from .conformance import IUserFolder_conformance -from Products.PluggableAuthService.utils import directlyProvides class DummyPlugin(Implicit): @@ -755,8 +755,8 @@ def test__extractUserIds_authenticate_emergency_user_broken_extor(self): from AccessControl.users import UnrestrictedUser + from .. import PluggableAuthService from ..interfaces.plugins import IExtractionPlugin - from Products.PluggableAuthService import PluggableAuthService old_eu = PluggableAuthService.emergency_user @@ -860,9 +860,9 @@ def test__extractUserIds_authenticate_emrgncy_with_broken_authicator(self): from AccessControl.users import UnrestrictedUser + from .. import PluggableAuthService from ..interfaces.plugins import IAuthenticationPlugin from ..interfaces.plugins import IExtractionPlugin - from Products.PluggableAuthService import PluggableAuthService old_eu = PluggableAuthService.emergency_user @@ -910,9 +910,9 @@ def test__extractUserIds_emergency_user_always_wins(self): from AccessControl.users import UnrestrictedUser + from .. import PluggableAuthService from ..interfaces.plugins import IAuthenticationPlugin from ..interfaces.plugins import IExtractionPlugin - from Products.PluggableAuthService import PluggableAuthService old_eu = PluggableAuthService.emergency_user @@ -983,9 +983,9 @@ def test__extractUserIds_emergency_user_always_wins_in_transform(self): from AccessControl.users import UnrestrictedUser + from .. import PluggableAuthService from ..interfaces.plugins import IAuthenticationPlugin from ..interfaces.plugins import IExtractionPlugin - from Products.PluggableAuthService import PluggableAuthService old_eu = PluggableAuthService.emergency_user @@ -1398,7 +1398,7 @@ def test__findEmergencyUser_no_plugins(self): from AccessControl.users import UnrestrictedUser - from Products.PluggableAuthService import PluggableAuthService + from .. import PluggableAuthService old_eu = PluggableAuthService.emergency_user diff --git a/Products/PluggableAuthService/tests/test_PropertiedUser.py b/Products/PluggableAuthService/tests/test_PropertiedUser.py index 282133b..fd7aaf8 100644 --- a/Products/PluggableAuthService/tests/test_PropertiedUser.py +++ b/Products/PluggableAuthService/tests/test_PropertiedUser.py @@ -38,7 +38,7 @@ class PropertiedUserTests(unittest.TestCase, IBasicUser_conformance, def _getTargetClass(self): - from Products.PluggableAuthService.PropertiedUser import PropertiedUser + from ..PropertiedUser import PropertiedUser return PropertiedUser diff --git a/Products/PluggableAuthService/tests/test_events.py b/Products/PluggableAuthService/tests/test_events.py index dfdc60a..899f616 100644 --- a/Products/PluggableAuthService/tests/test_events.py +++ b/Products/PluggableAuthService/tests/test_events.py @@ -19,20 +19,20 @@ class ConformsToIPASEvent: def test_class_conforms_to_IPASEvent(self): from zope.interface.verify import verifyClass - from Products.PluggableAuthService.interfaces.events import IPASEvent + from ..interfaces.events import IPASEvent verifyClass(IPASEvent, self._getTargetClass()) def test_instance_conforms_to_IPASEvent(self): from zope.interface.verify import verifyObject - from Products.PluggableAuthService.interfaces.events import IPASEvent + from ..interfaces.events import IPASEvent verifyObject(IPASEvent, self._makeOne()) class PASEventTests(unittest.TestCase, ConformsToIPASEvent): def _getTargetClass(self): - from Products.PluggableAuthService.events import PASEvent + from ..events import PASEvent return PASEvent def _makeOne(self, principal=None): @@ -44,7 +44,7 @@ def _makeOne(self, principal=None): class PrincipalCreatedTests(unittest.TestCase, ConformsToIPASEvent): def _getTargetClass(self): - from Products.PluggableAuthService.events import PrincipalCreated + from ..events import PrincipalCreated return PrincipalCreated def _makeOne(self, principal=None): @@ -68,7 +68,7 @@ def test_instance_conforms_to_IPrincipalCreatedEvent(self): class PrincipalDeletedTests(unittest.TestCase, ConformsToIPASEvent): def _getTargetClass(self): - from Products.PluggableAuthService.events import PrincipalDeleted + from ..events import PrincipalDeleted return PrincipalDeleted def _makeOne(self, principal=None): @@ -92,7 +92,7 @@ def test_instance_conforms_to_IPrincipalDeletedEvent(self): class CredentialsUpdatedTests(unittest.TestCase, ConformsToIPASEvent): def _getTargetClass(self): - from Products.PluggableAuthService.events import CredentialsUpdated + from ..events import CredentialsUpdated return CredentialsUpdated def _makeOne(self, principal=None, password='password'): @@ -116,7 +116,7 @@ def test_instance_conforms_to_ICredentialsUpdatedEvent(self): class PropertiesUpdatedTests(unittest.TestCase, ConformsToIPASEvent): def _getTargetClass(self): - from Products.PluggableAuthService.events import PropertiesUpdated + from ..events import PropertiesUpdated return PropertiesUpdated def _makeOne(self, principal=None, properties=None): @@ -146,7 +146,7 @@ class DummyPrincipal(object): class GroupCreatedTests(unittest.TestCase, ConformsToIPASEvent): def _getTargetClass(self): - from Products.PluggableAuthService.events import GroupCreated + from ..events import GroupCreated return GroupCreated def _makeOne(self, Group=None): @@ -170,7 +170,7 @@ def test_instance_conforms_to_IGroupCreatedEvent(self): class GroupDeletedTests(unittest.TestCase, ConformsToIPASEvent): def _getTargetClass(self): - from Products.PluggableAuthService.events import GroupDeleted + from ..events import GroupDeleted return GroupDeleted def _makeOne(self, Group=None): @@ -194,7 +194,7 @@ def test_instance_conforms_to_IGroupDeletedEvent(self): class PrincipalAddedToGroupTests(unittest.TestCase, ConformsToIPASEvent): def _getTargetClass(self): - from Products.PluggableAuthService.events import PrincipalAddedToGroup + from ..events import PrincipalAddedToGroup return PrincipalAddedToGroup def _makeOne(self, principal=None, group_id=None): diff --git a/Products/PluggableAuthService/tests/test_exportimport.py b/Products/PluggableAuthService/tests/test_exportimport.py index faf77e6..62743c5 100644 --- a/Products/PluggableAuthService/tests/test_exportimport.py +++ b/Products/PluggableAuthService/tests/test_exportimport.py @@ -21,7 +21,7 @@ from Products.GenericSetup.tests.common import BaseRegistryTests -from Products.PluggableAuthService.tests.utils import _setUpDefaultTraversable +from .utils import _setUpDefaultTraversable class _TestBase(PlacelessSetup, BaseRegistryTests): @@ -62,7 +62,7 @@ def _setUpAdapters(self): PluginRegistryFileExportImportAdapter from Products.PluginRegistry.interfaces import IPluginRegistry - from Products.PluggableAuthService.exportimport import PAS_CF_Namer + from ..exportimport import PAS_CF_Namer provideAdapter(FolderishExporterImporter, (IObjectManager,), @@ -95,7 +95,7 @@ def _setUpAdapters(self): def test_empty(self): from Products.GenericSetup.tests.common import DummyExportContext - from Products.PluggableAuthService.exportimport import exportPAS + from ..exportimport import exportPAS _setUpDefaultTraversable() @@ -130,7 +130,7 @@ def test_with_contents(self): from Products.GenericSetup.tests.faux_objects import TestCSVAware from Products.GenericSetup.utils import _getDottedName - from Products.PluggableAuthService.exportimport import exportPAS + from ..exportimport import exportPAS _setUpDefaultTraversable() @@ -233,7 +233,7 @@ def _setUpAdapters(self): def test_empty_modifying_plugin_types(self): from Products.GenericSetup.tests.common import DummyImportContext - from Products.PluggableAuthService.exportimport import importPAS + from ..exportimport import importPAS self._setUpAdapters() app, pas = self._initPAS() @@ -252,7 +252,7 @@ def test_empty_adding_plugins(self): from Products.GenericSetup.tests.faux_objects import KNOWN_CSV from Products.GenericSetup.tests.faux_objects import TestCSVAware - from Products.PluggableAuthService.exportimport import importPAS + from ..exportimport import importPAS self._setUpAdapters() app, pas = self._initPAS() diff --git a/Products/PluggableAuthService/tests/test_utils.py b/Products/PluggableAuthService/tests/test_utils.py index 0d2b1d1..7ce9e43 100644 --- a/Products/PluggableAuthService/tests/test_utils.py +++ b/Products/PluggableAuthService/tests/test_utils.py @@ -19,7 +19,7 @@ class Test_createViewName(unittest.TestCase): def _callFUT(self, *args, **kw): - from Products.PluggableAuthService.utils import createViewName + from ..utils import createViewName return createViewName(*args, **kw) def test_simple(self): @@ -51,7 +51,7 @@ def test_unicode_umlaut_in_handle(self): class Test_createKeywords(unittest.TestCase): def _callFUT(self, *args, **kw): - from Products.PluggableAuthService.utils import createKeywords + from ..utils import createKeywords return createKeywords(*args, **kw) def test_simple(self): @@ -115,7 +115,7 @@ class _Request(dict): class Test_getCSRFToken(unittest.TestCase): def _callFUT(self, *args, **kw): - from Products.PluggableAuthService.utils import getCSRFToken + from ..utils import getCSRFToken return getCSRFToken(*args, **kw) def test_wo_token_in_request(self): @@ -146,7 +146,7 @@ def test_session_fails_truth_test(self): class Test_checkCSRFToken(unittest.TestCase): def _callFUT(self, *args, **kw): - from Products.PluggableAuthService.utils import checkCSRFToken + from ..utils import checkCSRFToken return checkCSRFToken(*args, **kw) def test_wo_token_in_session_or_form_w_raises(self): @@ -198,7 +198,7 @@ def test_w_token_in_session_w_token_in_form_hit(self): class CSRFTokenTests(unittest.TestCase): def _getTargetClass(self): - from Products.PluggableAuthService.utils import CSRFToken + from ..utils import CSRFToken return CSRFToken def _makeOne(self, context=None, request=None): @@ -232,7 +232,7 @@ def test___call___raises(self): class Test_csrf_only(unittest.TestCase): def _callFUT(self, *args, **kw): - from Products.PluggableAuthService.utils import csrf_only + from ..utils import csrf_only return csrf_only(*args, **kw) def test_w_function_no_REQUEST(self): From 86091edfebb16ff530e07908be14018fa4757759 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 30 Oct 2020 10:14:49 +0100 Subject: [PATCH 7/8] - no longer need to define local folder --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 83d510f..49c9c90 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,6 @@ ignore = force_single_line = True combine_as_imports = True sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER -known_local_folder = Products.PluggableAuthService known_first_party = Products.PluginRegistry, Products.StandardCacheManagers, Products.GenericSetup known_third_party = six known_zope = From 327164ef007b3dcc5200ebd5e0bb3abf79377944 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 30 Oct 2020 10:01:43 +0100 Subject: [PATCH 8/8] Fix DeprecationWarnings occurring on Zope 5. --- CHANGES.rst | 2 +- Products/PluggableAuthService/PropertiedUser.py | 2 +- .../PluggableAuthService/plugins/NotCompetentHelper.py | 2 +- Products/PluggableAuthService/plugins/ZODBUserManager.py | 2 +- .../plugins/tests/test_ZODBUserManager.py | 8 ++++---- Products/PluggableAuthService/tests/test_UserFolder.py | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 7f745d1..d71a51a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ Change Log 2.5.1 (unreleased) ------------------ -- Nothing changed yet. +- Fix DeprecationWarnings occurring on Zope 5. 2.5 (2020-10-12) diff --git a/Products/PluggableAuthService/PropertiedUser.py b/Products/PluggableAuthService/PropertiedUser.py index 83574c2..4e61b28 100644 --- a/Products/PluggableAuthService/PropertiedUser.py +++ b/Products/PluggableAuthService/PropertiedUser.py @@ -15,7 +15,7 @@ """ from AccessControl.PermissionRole import _what_not_even_god_should_do -from AccessControl.User import BasicUser +from AccessControl.users import BasicUser from Acquisition import aq_inner from Acquisition import aq_parent diff --git a/Products/PluggableAuthService/plugins/NotCompetentHelper.py b/Products/PluggableAuthService/plugins/NotCompetentHelper.py index 8aab430..b97a9c9 100644 --- a/Products/PluggableAuthService/plugins/NotCompetentHelper.py +++ b/Products/PluggableAuthService/plugins/NotCompetentHelper.py @@ -23,7 +23,7 @@ from AccessControl import ClassSecurityInfo from AccessControl.Permissions import manage_users -from AccessControl.User import nobody +from AccessControl.users import nobody from Acquisition import aq_base from Acquisition import aq_inner from Acquisition import aq_parent diff --git a/Products/PluggableAuthService/plugins/ZODBUserManager.py b/Products/PluggableAuthService/plugins/ZODBUserManager.py index d098496..65ff736 100644 --- a/Products/PluggableAuthService/plugins/ZODBUserManager.py +++ b/Products/PluggableAuthService/plugins/ZODBUserManager.py @@ -18,11 +18,11 @@ import six -from AccessControl import AuthEncoding from AccessControl import ClassSecurityInfo from AccessControl.class_init import InitializeClass from AccessControl.requestmethod import postonly from AccessControl.SecurityManagement import getSecurityManager +from AuthEncoding import AuthEncoding from BTrees.OOBTree import OOBTree from OFS.Cache import Cacheable from Products.PageTemplates.PageTemplateFile import PageTemplateFile diff --git a/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py b/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py index 1691b83..7225302 100644 --- a/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py +++ b/Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py @@ -13,7 +13,7 @@ ############################################################################## import unittest -from AccessControl.AuthEncoding import pw_encrypt +from AuthEncoding.AuthEncoding import pw_encrypt from zExceptions import Forbidden from ...plugins.tests.helpers import makeRequestAndResponse @@ -521,7 +521,7 @@ def test_getUserByIdWithOptionalMangling(self): def test_addUser_with_not_yet_encrypted_password(self): # See collector #1869 && #1926 - from AccessControl.AuthEncoding import is_encrypted + from AuthEncoding.AuthEncoding import is_encrypted USER_ID = 'not_yet_encrypted' PASSWORD = 'password' @@ -538,7 +538,7 @@ def test_addUser_with_not_yet_encrypted_password(self): def test_addUser_with_preencrypted_password(self): # See collector #1869 && #1926 - from AccessControl.AuthEncoding import pw_encrypt + from AuthEncoding.AuthEncoding import pw_encrypt USER_ID = 'already_encrypted' PASSWORD = 'password' @@ -554,7 +554,7 @@ def test_addUser_with_preencrypted_password(self): self.assertEqual(uid_and_info, (USER_ID, USER_ID)) def test_updateUserPassword_with_not_yet_encrypted_password(self): - from AccessControl.AuthEncoding import is_encrypted + from AuthEncoding.AuthEncoding import is_encrypted USER_ID = 'not_yet_encrypted' PASSWORD = 'password' diff --git a/Products/PluggableAuthService/tests/test_UserFolder.py b/Products/PluggableAuthService/tests/test_UserFolder.py index 696e16d..769ae5e 100644 --- a/Products/PluggableAuthService/tests/test_UserFolder.py +++ b/Products/PluggableAuthService/tests/test_UserFolder.py @@ -224,7 +224,7 @@ def user_names(self): def test__doAddUser_with_not_yet_encrypted_passwords(self): # See collector #1869 && #1926 - from AccessControl.AuthEncoding import is_encrypted + from AuthEncoding.AuthEncoding import is_encrypted USER_ID = 'not_yet_encrypted' PASSWORD = 'password' @@ -240,7 +240,7 @@ def test__doAddUser_with_not_yet_encrypted_passwords(self): def test__doAddUser_with_preencrypted_passwords(self): # See collector #1869 && #1926 - from AccessControl.AuthEncoding import pw_encrypt + from AuthEncoding.AuthEncoding import pw_encrypt USER_ID = 'already_encrypted' PASSWORD = 'password'