From 7645fd658a8847682a3003f4af91722cfbd84c87 Mon Sep 17 00:00:00 2001 From: pbauer Date: Sat, 22 Jun 2019 09:25:48 +0200 Subject: [PATCH] [fc] Repository: Products.CMFFormController Branch: refs/heads/master Date: 2019-06-21T10:12:22+02:00 Author: Philip Bauer (pbauer) Commit: https://github.com/plone/Products.CMFFormController/commit/d4fdab8e1c8a2684688c176ef64126d1087323bc Add support for Python 3.8 Files changed: M Products/CMFFormController/Actions/BaseFormAction.py Repository: Products.CMFFormController Branch: refs/heads/master Date: 2019-06-21T10:14:07+02:00 Author: Philip Bauer (pbauer) Commit: https://github.com/plone/Products.CMFFormController/commit/6a14d7ef1dd90fb97bf52fc8bf86ee493fc5a41e add changenote Files changed: A news/20.feature Repository: Products.CMFFormController Branch: refs/heads/master Date: 2019-06-22T09:25:48+02:00 Author: Philip Bauer (pbauer) Commit: https://github.com/plone/Products.CMFFormController/commit/ae3b86032f89ee2675532c05b383f74f4e9f5c3a Merge pull request #20 from plone/python38 Add support for Python 3.8 Files changed: A news/20.feature M Products/CMFFormController/Actions/BaseFormAction.py --- last_commit.txt | 340 ++++-------------------------------------------- 1 file changed, 23 insertions(+), 317 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 3c0814cf15..80415a217c 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,342 +1,48 @@ -Repository: plone.restapi +Repository: Products.CMFFormController Branch: refs/heads/master -Date: 2019-06-21T21:26:45+02:00 -Author: Timo Stollenwerk (tisto) -Commit: https://github.com/plone/plone.restapi/commit/414be8004d49199b795e612635f4adb7489f91be +Date: 2019-06-21T10:12:22+02:00 +Author: Philip Bauer (pbauer) +Commit: https://github.com/plone/Products.CMFFormController/commit/d4fdab8e1c8a2684688c176ef64126d1087323bc -Add flake8-isort. +Add support for Python 3.8 Files changed: -M base.cfg +M Products/CMFFormController/Actions/BaseFormAction.py -b'diff --git a/base.cfg b/base.cfg\nindex 60addc79..61cbce80 100644\n--- a/base.cfg\n+++ b/base.cfg\n@@ -104,6 +104,7 @@ flake8-extensions =\n flake8-coding\n flake8-debugger\n flake8-print\n+ flake8-isort\n # additional pep8/flake8 rules, see docs for details\n # https://pep8.readthedocs.io/en/1.4.6/intro.html#error-codes\n # - E123: closing bracket does not match indentation of opening bracket\xe2\x80\x99s line\n' +b'diff --git a/Products/CMFFormController/Actions/BaseFormAction.py b/Products/CMFFormController/Actions/BaseFormAction.py\nindex 3595fe7..00231be 100644\n--- a/Products/CMFFormController/Actions/BaseFormAction.py\n+++ b/Products/CMFFormController/Actions/BaseFormAction.py\n@@ -7,6 +7,7 @@\n from Products.CMFFormController.utils import log\n from Products.PageTemplates.Expressions import getEngine\n from Products.PageTemplates.Expressions import SecureModuleImporter\n+from six.moves.urllib.parse import parse_qs\n from six.moves.urllib.parse import urlparse\n from six.moves.urllib.parse import urlunparse\n from zope.interface import implementer\n@@ -89,14 +90,13 @@ def getArg(self, controller_state):\n def combineArgs(self, url, kwargs):\n """Utility method that takes a URL, parses its existing query string,\n and combines the resulting dict with kwargs"""\n- import cgi\n \n # parse the existing URL\n parsed_url = list(urlparse(url))\n # get the existing query string\n qs = parsed_url[4]\n # parse the query into a dict\n- d = cgi.parse_qs(qs, 1)\n+ d = parse_qs(qs, 1)\n # update with stuff from kwargs\n for k, v in kwargs.items():\n if isinstance(v, six.text_type):\n' -Repository: plone.restapi +Repository: Products.CMFFormController Branch: refs/heads/master -Date: 2019-06-21T22:22:58+02:00 -Author: Timo Stollenwerk (tisto) -Commit: https://github.com/plone/plone.restapi/commit/915b73041dd995422b9bc18ef347c1a0e2e7a54b +Date: 2019-06-21T10:14:07+02:00 +Author: Philip Bauer (pbauer) +Commit: https://github.com/plone/Products.CMFFormController/commit/6a14d7ef1dd90fb97bf52fc8bf86ee493fc5a41e -Fix flake8 extensions. +add changenote Files changed: -M base.cfg -D .flake8 +A news/20.feature -b'diff --git a/.flake8 b/.flake8\ndeleted file mode 100644\nindex d163169f..00000000\n--- a/.flake8\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-# https://github.com/ambv/black/blob/master/.flake8\n-[flake8]\n-ignore = E203, E266, E501, W503\n-max-line-length = 88\n-max-complexity = 25\n-select = B,C,E,F,W,T4,B9\ndiff --git a/base.cfg b/base.cfg\nindex 61cbce80..58af89ea 100644\n--- a/base.cfg\n+++ b/base.cfg\n@@ -100,6 +100,9 @@ recipe = plone.recipe.codeanalysis\n directory = ${buildout:directory}/src\n flake8-exclude=bootstrap.py,bootstrap-buildout.py,docs,bin,*.egg,setup.py,overrides\n flake8-max-complexity = 25\n+# flake8-ignore = E203, E266, E501, W503\n+flake8-max-line-length = 88\n+# flake8-select = B,C,E,F,W,T4,B9\n flake8-extensions =\n flake8-coding\n flake8-debugger\n' +b'diff --git a/news/20.feature b/news/20.feature\nnew file mode 100644\nindex 0000000..c0eea9e\n--- /dev/null\n+++ b/news/20.feature\n@@ -0,0 +1 @@\n+Add support for Python 3.8 [pbauer]\n\\ No newline at end of file\n' -Repository: plone.restapi +Repository: Products.CMFFormController Branch: refs/heads/master -Date: 2019-06-21T22:31:58+02:00 -Author: Timo Stollenwerk (tisto) -Commit: https://github.com/plone/plone.restapi/commit/ead8da1172b78fdef29c6d7c305572fc54a42be2 +Date: 2019-06-22T09:25:48+02:00 +Author: Philip Bauer (pbauer) +Commit: https://github.com/plone/Products.CMFFormController/commit/ae3b86032f89ee2675532c05b383f74f4e9f5c3a -Set flake8-max-line-length to 200. +Merge pull request #20 from plone/python38 -Files changed: -M base.cfg - -b'diff --git a/base.cfg b/base.cfg\nindex 58af89ea..1ace2299 100644\n--- a/base.cfg\n+++ b/base.cfg\n@@ -101,7 +101,7 @@ directory = ${buildout:directory}/src\n flake8-exclude=bootstrap.py,bootstrap-buildout.py,docs,bin,*.egg,setup.py,overrides\n flake8-max-complexity = 25\n # flake8-ignore = E203, E266, E501, W503\n-flake8-max-line-length = 88\n+flake8-max-line-length = 200\n # flake8-select = B,C,E,F,W,T4,B9\n flake8-extensions =\n flake8-coding\n' - -Repository: plone.restapi - - -Branch: refs/heads/master -Date: 2019-06-21T22:32:40+02:00 -Author: Timo Stollenwerk (tisto) -Commit: https://github.com/plone/plone.restapi/commit/40ca3d269fa6c0abfdad693b2e61b9d8f99b3d4e - -Merge branch 'master' into isort - -Files changed: -A news/760.bugfix -M src/plone/restapi/services/workflow/transition.py -M src/plone/restapi/tests/test_workflow.py - -b'diff --git a/news/760.bugfix b/news/760.bugfix\nnew file mode 100644\nindex 00000000..6736bd21\n--- /dev/null\n+++ b/news/760.bugfix\n@@ -0,0 +1 @@\n+Set effective_date and reindex obj on workflow transitions. [wkbkhard]\n\\ No newline at end of file\ndiff --git a/src/plone/restapi/services/workflow/transition.py b/src/plone/restapi/services/workflow/transition.py\nindex 05cfb0ee..4897b03d 100644\n--- a/src/plone/restapi/services/workflow/transition.py\n+++ b/src/plone/restapi/services/workflow/transition.py\n@@ -16,6 +16,7 @@\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n from zope.publisher.interfaces import NotFound\n+from DateTime import DateTime\n \n import plone.protect.interfaces\n \n@@ -105,6 +106,10 @@ def recurse_transition(\n )\n deserializer(data=publication_dates)\n \n+ if obj.EffectiveDate() == \'None\':\n+ obj.setEffectiveDate(DateTime())\n+ obj.reindexObject()\n+\n self.wftool.doActionFor(obj, self.transition, comment=comment)\n if include_children and IFolderish.providedBy(obj):\n self.recurse_transition(\ndiff --git a/src/plone/restapi/tests/test_workflow.py b/src/plone/restapi/tests/test_workflow.py\nindex 659e530f..85b9e278 100644\n--- a/src/plone/restapi/tests/test_workflow.py\n+++ b/src/plone/restapi/tests/test_workflow.py\n@@ -1,4 +1,5 @@\n # -*- coding: utf-8 -*-\n+from DateTime import DateTime\n from Products.CMFCore.utils import getToolByName\n from ZPublisher.pubevents import PubStart\n from base64 import b64encode\n@@ -126,6 +127,15 @@ def test_transition_action_succeeds(self):\n u"published", self.wftool.getInfoFor(self.portal.doc1, u"review_state")\n )\n \n+ def test_transition_action_succeeds_changes_effective(self):\n+ doc1 = self.portal.doc1\n+ self.assertEqual(doc1.effective_date, None)\n+ now = DateTime()\n+ service = self.traverse(\'/plone/doc1/@workflow/publish\')\n+ service.reply()\n+ self.assertTrue(isinstance(doc1.effective_date, DateTime))\n+ self.assertTrue(doc1.effective_date >= now)\n+\n def test_calling_endpoint_without_transition_gives_400(self):\n service = self.traverse("/plone/doc1/@workflow")\n res = service.reply()\n' - -Repository: plone.restapi - - -Branch: refs/heads/master -Date: 2019-06-21T22:35:12+02:00 -Author: Timo Stollenwerk (tisto) -Commit: https://github.com/plone/plone.restapi/commit/e776446c8ad42619d76380145076ba987e06beb3 - -Run isort. - -Files changed: -M src/plone/restapi/__init__.py -M src/plone/restapi/batching.py -M src/plone/restapi/controlpanels.py -M src/plone/restapi/deserializer/atcontent.py -M src/plone/restapi/deserializer/atfields.py -M src/plone/restapi/deserializer/controlpanels.py -M src/plone/restapi/deserializer/dxcontent.py -M src/plone/restapi/deserializer/local_roles.py -M src/plone/restapi/deserializer/relationfield.py -M src/plone/restapi/deserializer/site.py -M src/plone/restapi/imaging.py -M src/plone/restapi/pas/plugin.py -M src/plone/restapi/serializer/atcontent.py -M src/plone/restapi/serializer/atfields.py -M src/plone/restapi/serializer/controlpanels.py -M src/plone/restapi/serializer/converters.py -M src/plone/restapi/serializer/expansion.py -M src/plone/restapi/serializer/registry.py -M src/plone/restapi/serializer/site.py -M src/plone/restapi/serializer/tile.py -M src/plone/restapi/serializer/user.py -M src/plone/restapi/services/__init__.py -M src/plone/restapi/services/actions/get.py -M src/plone/restapi/services/auth/login.py -M src/plone/restapi/services/auth/logout.py -M src/plone/restapi/services/auth/renew.py -M src/plone/restapi/services/breadcrumbs/get.py -M src/plone/restapi/services/content/sharing.py -M src/plone/restapi/services/content/tus.py -M src/plone/restapi/services/content/update.py -M src/plone/restapi/services/controlpanels/patch.py -M src/plone/restapi/services/discussion/conversation.py -M src/plone/restapi/services/email_send/post.py -M src/plone/restapi/services/groups/add.py -M src/plone/restapi/services/groups/get.py -M src/plone/restapi/services/groups/update.py -M src/plone/restapi/services/history/get.py -M src/plone/restapi/services/history/patch.py -M src/plone/restapi/services/navigation/get.py -M src/plone/restapi/services/registry/get.py -M src/plone/restapi/services/tiles/get.py -M src/plone/restapi/services/users/add.py -M src/plone/restapi/services/users/get.py -M src/plone/restapi/services/vocabularies/get.py -M src/plone/restapi/services/workflow/info.py -M src/plone/restapi/services/workflow/transition.py -M src/plone/restapi/setuphandlers.py -M src/plone/restapi/tests/attypes.py -M src/plone/restapi/tests/dxtypes.py -M src/plone/restapi/tests/mixin_ordering.py -M src/plone/restapi/tests/performance.py -M src/plone/restapi/tests/test_atcollection.py -M src/plone/restapi/tests/test_atcontent_deserializer.py -M src/plone/restapi/tests/test_atcontent_serializer.py -M src/plone/restapi/tests/test_atfield_deserializer.py -M src/plone/restapi/tests/test_atfield_serializer.py -M src/plone/restapi/tests/test_auth.py -M src/plone/restapi/tests/test_batching.py -M src/plone/restapi/tests/test_boolean_value.py -M src/plone/restapi/tests/test_comments.py -M src/plone/restapi/tests/test_content_delete.py -M src/plone/restapi/tests/test_content_get.py -M src/plone/restapi/tests/test_content_local_roles.py -M src/plone/restapi/tests/test_copymove.py -M src/plone/restapi/tests/test_documentation.py -M src/plone/restapi/tests/test_dxcontent_deserializer.py -M src/plone/restapi/tests/test_dxcontent_serializer.py -M src/plone/restapi/tests/test_dxfield_deserializer.py -M src/plone/restapi/tests/test_dxfield_serializer.py -M src/plone/restapi/tests/test_error_handling.py -M src/plone/restapi/tests/test_expansion.py -M src/plone/restapi/tests/test_functional_auth.py -M src/plone/restapi/tests/test_locking.py -M src/plone/restapi/tests/test_pas.py -M src/plone/restapi/tests/test_permissions.py -M src/plone/restapi/tests/test_profile_tiles.py -M src/plone/restapi/tests/test_query_parsers.py -M src/plone/restapi/tests/test_registry.py -M src/plone/restapi/tests/test_registry_serializer.py -M src/plone/restapi/tests/test_serializer_converters.py -M src/plone/restapi/tests/test_services.py -M src/plone/restapi/tests/test_services_actions.py -M src/plone/restapi/tests/test_services_comments.py -M src/plone/restapi/tests/test_services_content.py -M src/plone/restapi/tests/test_services_controlpanels.py -M src/plone/restapi/tests/test_services_email_notification.py -M src/plone/restapi/tests/test_services_email_send.py -M src/plone/restapi/tests/test_services_history.py -M src/plone/restapi/tests/test_services_types.py -M src/plone/restapi/tests/test_services_users.py -M src/plone/restapi/tests/test_services_vocabularies.py -M src/plone/restapi/tests/test_setup.py -M src/plone/restapi/tests/test_site_serializer.py -M src/plone/restapi/tests/test_time_freezing.py -M src/plone/restapi/tests/test_tus.py -M src/plone/restapi/tests/test_workflow.py -M src/plone/restapi/types/adapters.py -M src/plone/restapi/types/utils.py -M src/plone/restapi/types/z3crelationadapter.py - -b'diff --git a/src/plone/restapi/__init__.py b/src/plone/restapi/__init__.py\nindex a6dbf5d6..bf144d63 100644\n--- a/src/plone/restapi/__init__.py\n+++ b/src/plone/restapi/__init__.py\n@@ -1,14 +1,13 @@\n # -*- coding: utf-8 -*-\n from AccessControl import allow_module\n from AccessControl.Permissions import add_user_folders\n-from Products.PluggableAuthService.PluggableAuthService import (\n- registerMultiPlugin,\n-) # noqa\n from plone.restapi.pas import plugin\n+from Products.PluggableAuthService.PluggableAuthService import registerMultiPlugin # noqa\n from zope.i18nmessageid import MessageFactory\n \n import pkg_resources\n \n+\n _ = MessageFactory("plone.restapi")\n PROJECT_NAME = "plone.restapi"\n \ndiff --git a/src/plone/restapi/batching.py b/src/plone/restapi/batching.py\nindex c25479d5..9930c21b 100644\n--- a/src/plone/restapi/batching.py\n+++ b/src/plone/restapi/batching.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n from plone.batching.batch import Batch\n-from six.moves.urllib.parse import urlencode\n from six.moves.urllib.parse import parse_qsl\n+from six.moves.urllib.parse import urlencode\n \n \n DEFAULT_BATCH_SIZE = 25\ndiff --git a/src/plone/restapi/controlpanels.py b/src/plone/restapi/controlpanels.py\nindex 9b954f6d..66237fa7 100644\n--- a/src/plone/restapi/controlpanels.py\n+++ b/src/plone/restapi/controlpanels.py\n@@ -1,19 +1,20 @@\n # -*- coding: utf-8 -*-\n-from zope.interface import implementer, Interface, Attribute\n-from zope.component import adapter\n from Products.CMFCore.utils import getToolByName\n-\n from Products.CMFPlone.interfaces.controlpanel import IDateAndTimeSchema\n from Products.CMFPlone.interfaces.controlpanel import IEditingSchema\n+from Products.CMFPlone.interfaces.controlpanel import IImagingSchema\n from Products.CMFPlone.interfaces.controlpanel import ILanguageSchema\n from Products.CMFPlone.interfaces.controlpanel import IMailSchema\n+from Products.CMFPlone.interfaces.controlpanel import IMarkupSchema\n from Products.CMFPlone.interfaces.controlpanel import INavigationSchema\n-from Products.CMFPlone.interfaces.controlpanel import ISiteSchema\n from Products.CMFPlone.interfaces.controlpanel import ISearchSchema\n-from Products.CMFPlone.interfaces.controlpanel import ISocialMediaSchema\n-from Products.CMFPlone.interfaces.controlpanel import IImagingSchema\n-from Products.CMFPlone.interfaces.controlpanel import IMarkupSchema\n from Products.CMFPlone.interfaces.controlpanel import ISecuritySchema\n+from Products.CMFPlone.interfaces.controlpanel import ISiteSchema\n+from Products.CMFPlone.interfaces.controlpanel import ISocialMediaSchema\n+from zope.component import adapter\n+from zope.interface import Attribute\n+from zope.interface import implementer\n+from zope.interface import Interface\n \n \n class IControlpanel(Interface):\ndiff --git a/src/plone/restapi/deserializer/atcontent.py b/src/plone/restapi/deserializer/atcontent.py\nindex c4a3afa0..63bc7d8c 100644\n--- a/src/plone/restapi/deserializer/atcontent.py\n+++ b/src/plone/restapi/deserializer/atcontent.py\n@@ -1,21 +1,20 @@\n # -*- coding: utf-8 -*-\n+from .mixins import OrderingMixin\n+from plone.restapi.deserializer import json_body\n+from plone.restapi.interfaces import IDeserializeFromJson\n+from plone.restapi.interfaces import IFieldDeserializer\n from Products.Archetypes.event import ObjectEditedEvent\n from Products.Archetypes.event import ObjectInitializedEvent\n from Products.Archetypes.interfaces import IBaseObject\n from Products.Archetypes.interfaces import IObjectPostValidation\n from Products.Archetypes.interfaces import IObjectPreValidation\n-from plone.restapi.deserializer import json_body\n-from plone.restapi.interfaces import IDeserializeFromJson\n-from plone.restapi.interfaces import IFieldDeserializer\n from zExceptions import BadRequest\n from zope.component import adapter\n from zope.component import queryMultiAdapter\n from zope.component import subscribers\n from zope.event import notify\n-from zope.interface import Interface\n from zope.interface import implementer\n-\n-from .mixins import OrderingMixin\n+from zope.interface import Interface\n \n \n @implementer(IDeserializeFromJson)\ndiff --git a/src/plone/restapi/deserializer/atfields.py b/src/plone/restapi/deserializer/atfields.py\nindex 5cb4be16..2e2ccd05 100644\n--- a/src/plone/restapi/deserializer/atfields.py\n+++ b/src/plone/restapi/deserializer/atfields.py\n@@ -1,11 +1,11 @@\n # -*- coding: utf-8 -*-\n+from plone.app.blob.interfaces import IBlobField\n+from plone.restapi.interfaces import IFieldDeserializer\n+from plone.restapi.services.content.tus import TUSUpload\n from Products.Archetypes.interfaces import IBaseObject\n from Products.Archetypes.interfaces.field import IField\n from Products.Archetypes.interfaces.field import IFileField\n from Products.Archetypes.interfaces.field import IReferenceField\n-from plone.app.blob.interfaces import IBlobField\n-from plone.restapi.interfaces import IFieldDeserializer\n-from plone.restapi.services.content.tus import TUSUpload\n from zope.component import adapter\n from zope.component import getMultiAdapter\n from zope.interface import implementer\ndiff --git a/src/plone/restapi/deserializer/controlpanels.py b/src/plone/restapi/deserializer/controlpanels.py\nindex 5aebcf2c..9a8b01eb 100644\n--- a/src/plone/restapi/deserializer/controlpanels.py\n+++ b/src/plone/restapi/deserializer/controlpanels.py\n@@ -1,18 +1,18 @@\n # -*- coding: utf-8 -*-\n+from plone.dexterity.interfaces import IDexterityContent\n from plone.registry.interfaces import IRegistry\n from plone.restapi.controlpanels import IControlpanel\n from plone.restapi.deserializer import json_body\n from plone.restapi.interfaces import IDeserializeFromJson\n+from plone.restapi.interfaces import IFieldDeserializer\n+from z3c.form.interfaces import IManagerValidator\n from zExceptions import BadRequest\n from zope.component import adapter\n from zope.component import getUtility\n+from zope.component import queryMultiAdapter\n from zope.interface import implementer\n from zope.schema import getFields\n from zope.schema.interfaces import ValidationError\n-from plone.dexterity.interfaces import IDexterityContent\n-from zope.component import queryMultiAdapter\n-from plone.restapi.interfaces import IFieldDeserializer\n-from z3c.form.interfaces import IManagerValidator\n \n \n @implementer(IDexterityContent)\ndiff --git a/src/plone/restapi/deserializer/dxcontent.py b/src/plone/restapi/deserializer/dxcontent.py\nindex 33876ba2..536ebb50 100644\n--- a/src/plone/restapi/deserializer/dxcontent.py\n+++ b/src/plone/restapi/deserializer/dxcontent.py\n@@ -1,4 +1,5 @@\n # -*- coding: utf-8 -*-\n+from .mixins import OrderingMixin\n from AccessControl import getSecurityManager\n from plone.autoform.interfaces import WRITE_PERMISSIONS_KEY\n from plone.dexterity.interfaces import IDexterityContent\n@@ -14,16 +15,14 @@\n from zope.component import queryMultiAdapter\n from zope.component import queryUtility\n from zope.event import notify\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n from zope.lifecycleevent import Attributes\n from zope.lifecycleevent import ObjectModifiedEvent\n from zope.schema import getFields\n from zope.schema.interfaces import ValidationError\n from zope.security.interfaces import IPermission\n \n-from .mixins import OrderingMixin\n-\n \n @implementer(IDeserializeFromJson)\n @adapter(IDexterityContent, Interface)\ndiff --git a/src/plone/restapi/deserializer/local_roles.py b/src/plone/restapi/deserializer/local_roles.py\nindex 8a24c2b0..375eb062 100644\n--- a/src/plone/restapi/deserializer/local_roles.py\n+++ b/src/plone/restapi/deserializer/local_roles.py\n@@ -9,6 +9,7 @@\n from zope.interface import implementer\n from zope.interface import Interface\n \n+\n try:\n from plone.app.workflow.events import LocalrolesModifiedEvent\n \ndiff --git a/src/plone/restapi/deserializer/relationfield.py b/src/plone/restapi/deserializer/relationfield.py\nindex 3d07b8a1..67c0e913 100644\n--- a/src/plone/restapi/deserializer/relationfield.py\n+++ b/src/plone/restapi/deserializer/relationfield.py\n@@ -1,8 +1,8 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n from plone.dexterity.interfaces import IDexterityContent\n from plone.restapi.deserializer.dxfields import DefaultFieldDeserializer\n from plone.restapi.interfaces import IFieldDeserializer\n+from Products.CMFCore.utils import getToolByName\n from z3c.relationfield.interfaces import IRelationChoice\n from zope.component import adapter\n from zope.component import getMultiAdapter\n@@ -10,6 +10,7 @@\n from zope.interface import implementer\n from zope.intid.interfaces import IIntIds\n from zope.publisher.interfaces.browser import IBrowserRequest\n+\n import six\n \n \ndiff --git a/src/plone/restapi/deserializer/site.py b/src/plone/restapi/deserializer/site.py\nindex c66d9069..68615612 100644\n--- a/src/plone/restapi/deserializer/site.py\n+++ b/src/plone/restapi/deserializer/site.py\n@@ -1,11 +1,10 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFPlone.interfaces import IPloneSiteRoot\n from plone.restapi.deserializer import json_body\n+from plone.restapi.deserializer.mixins import OrderingMixin\n from plone.restapi.interfaces import IDeserializeFromJson\n+from Products.CMFPlone.interfaces import IPloneSiteRoot\n from zope.component import adapter\n from zope.interface import implementer\n-\n-from plone.restapi.deserializer.mixins import OrderingMixin\n from zope.publisher.interfaces import IRequest\n \n import json\ndiff --git a/src/plone/restapi/imaging.py b/src/plone/restapi/imaging.py\nindex 827614d5..5a94ef1c 100644\n--- a/src/plone/restapi/imaging.py\n+++ b/src/plone/restapi/imaging.py\n@@ -1,10 +1,11 @@\n # -*- coding: utf-8 -*-\n from __future__ import division\n from Products.CMFCore.interfaces import IPropertiesTool\n+from six.moves import map\n from zope.component import getMultiAdapter\n from zope.component import getUtility\n from zope.globalrequest import getRequest\n-from six.moves import map\n+\n \n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\ndiff --git a/src/plone/restapi/pas/plugin.py b/src/plone/restapi/pas/plugin.py\nindex 7b457345..58a34564 100644\n--- a/src/plone/restapi/pas/plugin.py\n+++ b/src/plone/restapi/pas/plugin.py\n@@ -1,20 +1,21 @@\n # -*- coding: utf-8 -*-\n-from AccessControl.SecurityInfo import ClassSecurityInfo\n from AccessControl.requestmethod import postonly\n+from AccessControl.SecurityInfo import ClassSecurityInfo\n from BTrees.OIBTree import OIBTree\n from BTrees.OOBTree import OOBTree\n+from datetime import datetime\n+from datetime import timedelta\n+from plone.keyring.interfaces import IKeyManager\n+from plone.keyring.keyring import GenerateSecret\n from Products.CMFCore.permissions import ManagePortal\n from Products.PageTemplates.PageTemplateFile import PageTemplateFile\n from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin\n from Products.PluggableAuthService.interfaces.plugins import IChallengePlugin\n from Products.PluggableAuthService.interfaces.plugins import IExtractionPlugin\n from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin\n-from datetime import datetime\n-from datetime import timedelta\n-from plone.keyring.interfaces import IKeyManager\n-from plone.keyring.keyring import GenerateSecret\n from zope.component import getUtility\n from zope.interface import implementer\n+\n import jwt\n import six\n import time\ndiff --git a/src/plone/restapi/serializer/atcontent.py b/src/plone/restapi/serializer/atcontent.py\nindex cb659f3f..36d22391 100644\n--- a/src/plone/restapi/serializer/atcontent.py\n+++ b/src/plone/restapi/serializer/atcontent.py\n@@ -1,20 +1,20 @@\n # -*- coding: utf-8 -*-\n from Acquisition import aq_inner\n from Acquisition import aq_parent\n-from Products.Archetypes.interfaces import IBaseFolder\n-from Products.Archetypes.interfaces import IBaseObject\n-from Products.CMFCore.utils import getToolByName\n from plone.restapi.batching import HypermediaBatch\n from plone.restapi.deserializer import boolean_value\n from plone.restapi.interfaces import IFieldSerializer\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.interfaces import ISerializeToJsonSummary\n from plone.restapi.serializer.expansion import expandable_elements\n+from Products.Archetypes.interfaces import IBaseFolder\n+from Products.Archetypes.interfaces import IBaseObject\n+from Products.CMFCore.utils import getToolByName\n from zope.component import adapter\n from zope.component import getMultiAdapter\n from zope.component import queryMultiAdapter\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n \n \n @implementer(ISerializeToJson)\ndiff --git a/src/plone/restapi/serializer/atfields.py b/src/plone/restapi/serializer/atfields.py\nindex 9c12d1f9..4a12f013 100644\n--- a/src/plone/restapi/serializer/atfields.py\n+++ b/src/plone/restapi/serializer/atfields.py\n@@ -1,6 +1,10 @@\n # -*- coding: utf-8 -*-\n-from six.moves import map\n-\n+from plone.app.blob.interfaces import IBlobField\n+from plone.app.blob.interfaces import IBlobImageField\n+from plone.restapi.imaging import get_original_image_url\n+from plone.restapi.imaging import get_scales\n+from plone.restapi.interfaces import IFieldSerializer\n+from plone.restapi.serializer.converters import json_compatible\n from Products.Archetypes.interfaces import IBaseObject\n from Products.Archetypes.interfaces.field import IField\n from Products.Archetypes.interfaces.field import IFileField\n@@ -8,15 +12,11 @@\n from Products.Archetypes.interfaces.field import IReferenceField\n from Products.Archetypes.interfaces.field import ITextField\n from Products.CMFCore.utils import getToolByName\n-from plone.app.blob.interfaces import IBlobField\n-from plone.app.blob.interfaces import IBlobImageField\n-from plone.restapi.imaging import get_scales\n-from plone.restapi.imaging import get_original_image_url\n-from plone.restapi.interfaces import IFieldSerializer\n-from plone.restapi.serializer.converters import json_compatible\n+from six.moves import map\n from zope.component import adapter\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n+\n \n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\ndiff --git a/src/plone/restapi/serializer/controlpanels.py b/src/plone/restapi/serializer/controlpanels.py\nindex 5a95eb3f..cd5c0a52 100644\n--- a/src/plone/restapi/serializer/controlpanels.py\n+++ b/src/plone/restapi/serializer/controlpanels.py\n@@ -7,13 +7,16 @@\n from plone.restapi.interfaces import ISerializeToJsonSummary\n from plone.restapi.serializer.converters import json_compatible\n from plone.restapi.types import utils\n-from zope.component import adapter, queryMultiAdapter, getUtility\n+from zope.component import adapter\n+from zope.component import getUtility\n+from zope.component import queryMultiAdapter\n from zope.interface import alsoProvides\n from zope.interface import implementer\n from zope.interface import noLongerProvides\n \n import zope.schema\n \n+\n SERVICE_ID = "@controlpanels"\n \n \ndiff --git a/src/plone/restapi/serializer/converters.py b/src/plone/restapi/serializer/converters.py\nindex f44af42b..cf1e18ec 100644\n--- a/src/plone/restapi/serializer/converters.py\n+++ b/src/plone/restapi/serializer/converters.py\n@@ -1,9 +1,9 @@\n # -*- coding: utf-8 -*-\n-from DateTime import DateTime\n from datetime import date\n from datetime import datetime\n from datetime import time\n from datetime import timedelta\n+from DateTime import DateTime\n from persistent.list import PersistentList\n from persistent.mapping import PersistentMapping\n from plone.app.textfield.interfaces import IRichTextValue\n@@ -11,6 +11,8 @@\n from plone.restapi.interfaces import IContextawareJsonCompatible\n from plone.restapi.interfaces import IJsonCompatible\n from Products.CMFPlone.utils import safe_unicode\n+from six.moves import map\n+from six.moves import zip\n from zope.component import adapter\n from zope.component import queryMultiAdapter\n from zope.globalrequest import getRequest\n@@ -22,8 +24,7 @@\n import Missing\n import pytz\n import six\n-from six.moves import map\n-from six.moves import zip\n+\n \n # import re\n \ndiff --git a/src/plone/restapi/serializer/expansion.py b/src/plone/restapi/serializer/expansion.py\nindex 901b1e92..552c233d 100644\n--- a/src/plone/restapi/serializer/expansion.py\n+++ b/src/plone/restapi/serializer/expansion.py\n@@ -1,6 +1,7 @@\n # -*- coding: utf-8 -*-\n from plone.restapi.interfaces import IExpandableElement\n from zope.component import getAdapters\n+\n import six\n \n \ndiff --git a/src/plone/restapi/serializer/registry.py b/src/plone/restapi/serializer/registry.py\nindex a9014a74..8d2f1c6f 100644\n--- a/src/plone/restapi/serializer/registry.py\n+++ b/src/plone/restapi/serializer/registry.py\n@@ -1,9 +1,10 @@\n # -*- coding: utf-8 -*-\n+from plone.registry.interfaces import IRegistry\n from plone.restapi.batching import HypermediaBatch\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.types.interfaces import IJsonSchemaProvider\n-from plone.registry.interfaces import IRegistry\n-from zope.component import adapter, getMultiAdapter\n+from zope.component import adapter\n+from zope.component import getMultiAdapter\n from zope.interface import implementer\n from zope.publisher.interfaces import IRequest\n \ndiff --git a/src/plone/restapi/serializer/site.py b/src/plone/restapi/serializer/site.py\nindex 0aeb3f71..243c7213 100644\n--- a/src/plone/restapi/serializer/site.py\n+++ b/src/plone/restapi/serializer/site.py\n@@ -1,14 +1,14 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n-from Products.CMFPlone.interfaces import IPloneSiteRoot\n from plone.restapi.batching import HypermediaBatch\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.interfaces import ISerializeToJsonSummary\n from plone.restapi.serializer.expansion import expandable_elements\n+from Products.CMFCore.utils import getToolByName\n+from Products.CMFPlone.interfaces import IPloneSiteRoot\n from zope.component import adapter\n from zope.component import getMultiAdapter\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n \n import json\n \ndiff --git a/src/plone/restapi/serializer/tile.py b/src/plone/restapi/serializer/tile.py\nindex df93e6f7..567a9996 100644\n--- a/src/plone/restapi/serializer/tile.py\n+++ b/src/plone/restapi/serializer/tile.py\n@@ -2,11 +2,12 @@\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.interfaces import ISerializeToJsonSummary\n from plone.restapi.types import utils\n-from zope.interface import implementer\n-from zope.interface import Interface\n from plone.tiles.interfaces import ITileType\n from zope.component import adapter\n from zope.component.hooks import getSite\n+from zope.interface import implementer\n+from zope.interface import Interface\n+\n \n SERVICE_ID = "@tiles"\n \ndiff --git a/src/plone/restapi/serializer/user.py b/src/plone/restapi/serializer/user.py\nindex c4b06594..481c829b 100644\n--- a/src/plone/restapi/serializer/user.py\n+++ b/src/plone/restapi/serializer/user.py\n@@ -11,6 +11,7 @@\n from zope.publisher.interfaces import IRequest\n from zope.schema import getFieldNames\n \n+\n try:\n # Plone 5\n from plone.app.users.browser.userdatapanel import getUserDataSchema\ndiff --git a/src/plone/restapi/services/__init__.py b/src/plone/restapi/services/__init__.py\nindex d2986d9d..5f8e72a7 100644\n--- a/src/plone/restapi/services/__init__.py\n+++ b/src/plone/restapi/services/__init__.py\n@@ -6,6 +6,7 @@\n \n import json\n \n+\n _no_content_marker = object()\n \n \ndiff --git a/src/plone/restapi/services/actions/get.py b/src/plone/restapi/services/actions/get.py\nindex cb5f8111..e37bb054 100644\n--- a/src/plone/restapi/services/actions/get.py\n+++ b/src/plone/restapi/services/actions/get.py\n@@ -1,13 +1,13 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.interfaces import IActionCategory\n-from Products.CMFCore.utils import getToolByName\n from plone.restapi.interfaces import IExpandableElement\n from plone.restapi.services import Service\n+from Products.CMFCore.interfaces import IActionCategory\n+from Products.CMFCore.utils import getToolByName\n from zope.component import adapter\n from zope.component import getMultiAdapter\n from zope.i18n import translate\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n \n \n @implementer(IExpandableElement)\ndiff --git a/src/plone/restapi/services/auth/login.py b/src/plone/restapi/services/auth/login.py\nindex aa618dd2..64760248 100644\n--- a/src/plone/restapi/services/auth/login.py\n+++ b/src/plone/restapi/services/auth/login.py\n@@ -4,9 +4,7 @@\n from plone.restapi.deserializer import json_body\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n-from Products.PluggableAuthService.interfaces.plugins import (\n- IAuthenticationPlugin,\n-) # noqa\n+from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin # noqa\n from zope.interface import alsoProvides\n \n import plone.protect.interfaces\ndiff --git a/src/plone/restapi/services/auth/logout.py b/src/plone/restapi/services/auth/logout.py\nindex bbca18c3..f24ab14b 100644\n--- a/src/plone/restapi/services/auth/logout.py\n+++ b/src/plone/restapi/services/auth/logout.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n+from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin\n-from plone.restapi.services import Service\n \n \n class Logout(Service):\ndiff --git a/src/plone/restapi/services/auth/renew.py b/src/plone/restapi/services/auth/renew.py\nindex 01362244..7a99e2b9 100644\n--- a/src/plone/restapi/services/auth/renew.py\n+++ b/src/plone/restapi/services/auth/renew.py\n@@ -1,9 +1,7 @@\n # -*- coding: utf-8 -*-\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n-from Products.PluggableAuthService.interfaces.plugins import (\n- IAuthenticationPlugin,\n-) # noqa\n+from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin # noqa\n from zope.interface import alsoProvides\n \n import plone.protect.interfaces\ndiff --git a/src/plone/restapi/services/breadcrumbs/get.py b/src/plone/restapi/services/breadcrumbs/get.py\nindex fff5bc6a..ab11ca3e 100644\n--- a/src/plone/restapi/services/breadcrumbs/get.py\n+++ b/src/plone/restapi/services/breadcrumbs/get.py\n@@ -3,8 +3,8 @@\n from plone.restapi.services import Service\n from zope.component import adapter\n from zope.component import getMultiAdapter\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n \n \n @implementer(IExpandableElement)\ndiff --git a/src/plone/restapi/services/content/sharing.py b/src/plone/restapi/services/content/sharing.py\nindex 791add05..459c2035 100644\n--- a/src/plone/restapi/services/content/sharing.py\n+++ b/src/plone/restapi/services/content/sharing.py\n@@ -3,8 +3,8 @@\n from plone.restapi.interfaces import IDeserializeFromJson\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.services import Service\n-from zope.interface import alsoProvides\n from zope.component import queryMultiAdapter\n+from zope.interface import alsoProvides\n from zope.security import checkPermission\n \n import plone.protect.interfaces\ndiff --git a/src/plone/restapi/services/content/tus.py b/src/plone/restapi/services/content/tus.py\nindex 4a8057e6..c26876e9 100644\n--- a/src/plone/restapi/services/content/tus.py\n+++ b/src/plone/restapi/services/content/tus.py\n@@ -1,10 +1,7 @@\n # -*- coding: utf-8 -*-\n+from AccessControl.SecurityManagement import getSecurityManager\n from Acquisition import aq_base\n from Acquisition.interfaces import IAcquirer\n-from AccessControl.SecurityManagement import getSecurityManager\n-from Products.CMFCore.utils import getToolByName\n-from Products.CMFPlone.utils import base_hasattr\n-from Products.CMFPlone.utils import safe_hasattr\n from base64 import b64decode\n from email.utils import formatdate\n from fnmatch import fnmatch\n@@ -12,22 +9,26 @@\n from plone.restapi.exceptions import DeserializationError\n from plone.restapi.interfaces import IDeserializeFromJson\n from plone.restapi.services import Service\n-from plone.restapi.services.content.utils import create\n from plone.restapi.services.content.utils import add\n+from plone.restapi.services.content.utils import create\n from plone.rfc822.interfaces import IPrimaryFieldInfo\n+from Products.CMFCore.utils import getToolByName\n+from Products.CMFPlone.utils import base_hasattr\n+from Products.CMFPlone.utils import safe_hasattr\n from uuid import uuid4\n from zExceptions import Unauthorized\n from zope.component import queryMultiAdapter\n+from zope.event import notify\n from zope.interface import implementer\n+from zope.lifecycleevent import ObjectCreatedEvent\n from zope.publisher.interfaces import IPublishTraverse\n from zope.publisher.interfaces import NotFound\n-from zope.lifecycleevent import ObjectCreatedEvent\n-from zope.event import notify\n \n import json\n import os\n import time\n \n+\n TUS_OPTIONS_RESPONSE_HEADERS = {\n "Tus-Resumable": "1.0.0",\n "Tus-Version": "1.0.0",\ndiff --git a/src/plone/restapi/services/content/update.py b/src/plone/restapi/services/content/update.py\nindex b9d697eb..6066985a 100644\n--- a/src/plone/restapi/services/content/update.py\n+++ b/src/plone/restapi/services/content/update.py\n@@ -1,6 +1,7 @@\n # -*- coding: utf-8 -*-\n from plone.restapi.exceptions import DeserializationError\n-from plone.restapi.interfaces import IDeserializeFromJson, ISerializeToJson\n+from plone.restapi.interfaces import IDeserializeFromJson\n+from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.services import Service\n from plone.restapi.services.locking.locking import is_locked\n from zope.component import queryMultiAdapter\ndiff --git a/src/plone/restapi/services/controlpanels/patch.py b/src/plone/restapi/services/controlpanels/patch.py\nindex 5bbcc6e3..8002f98b 100644\n--- a/src/plone/restapi/services/controlpanels/patch.py\n+++ b/src/plone/restapi/services/controlpanels/patch.py\n@@ -2,10 +2,10 @@\n from plone.restapi.controlpanels import IControlpanel\n from plone.restapi.interfaces import IDeserializeFromJson\n from plone.restapi.services import Service\n+from zExceptions import BadRequest\n from zope.component import getAdapters\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n-from zExceptions import BadRequest\n \n \n @implementer(IPublishTraverse)\ndiff --git a/src/plone/restapi/services/discussion/conversation.py b/src/plone/restapi/services/discussion/conversation.py\nindex e9899654..17ab841f 100644\n--- a/src/plone/restapi/services/discussion/conversation.py\n+++ b/src/plone/restapi/services/discussion/conversation.py\n@@ -1,4 +1,5 @@\n # -*- coding: utf-8 -*-\n+from datetime import datetime\n from plone.app.discussion.browser.comment import EditCommentForm\n from plone.app.discussion.browser.comments import CommentForm\n from plone.app.discussion.interfaces import IConversation\n@@ -19,7 +20,6 @@\n from zope.publisher.interfaces import IPublishTraverse\n from zope.security.interfaces import IPermission\n \n-from datetime import datetime\n import plone.protect.interfaces\n \n \ndiff --git a/src/plone/restapi/services/email_send/post.py b/src/plone/restapi/services/email_send/post.py\nindex 61c1f61b..41cfcf42 100644\n--- a/src/plone/restapi/services/email_send/post.py\n+++ b/src/plone/restapi/services/email_send/post.py\n@@ -7,12 +7,12 @@\n from plone.restapi.deserializer import json_body\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n+from Products.CMFPlone.interfaces import ISiteSchema\n from Products.CMFPlone.interfaces.controlpanel import IMailSchema\n from smtplib import SMTPException\n from zope.component import getMultiAdapter\n from zope.component import getUtility\n from zope.interface import alsoProvides\n-from Products.CMFPlone.interfaces import ISiteSchema\n \n import plone\n \ndiff --git a/src/plone/restapi/services/groups/add.py b/src/plone/restapi/services/groups/add.py\nindex 499d821f..825fa498 100644\n--- a/src/plone/restapi/services/groups/add.py\n+++ b/src/plone/restapi/services/groups/add.py\n@@ -3,9 +3,9 @@\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n+from zExceptions import BadRequest\n from zope.component import queryMultiAdapter\n from zope.component.hooks import getSite\n-from zExceptions import BadRequest\n from zope.interface import alsoProvides\n \n import plone.protect.interfaces\ndiff --git a/src/plone/restapi/services/groups/get.py b/src/plone/restapi/services/groups/get.py\nindex d1c5a570..874fa272 100644\n--- a/src/plone/restapi/services/groups/get.py\n+++ b/src/plone/restapi/services/groups/get.py\n@@ -4,11 +4,12 @@\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n from zExceptions import BadRequest\n-from zope.component.hooks import getSite\n from zope.component import queryMultiAdapter\n+from zope.component.hooks import getSite\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n \n+\n DEFAULT_SEARCH_RESULTS_LIMIT = 25\n \n \ndiff --git a/src/plone/restapi/services/groups/update.py b/src/plone/restapi/services/groups/update.py\nindex f25b75ed..00b06a2d 100644\n--- a/src/plone/restapi/services/groups/update.py\n+++ b/src/plone/restapi/services/groups/update.py\n@@ -4,7 +4,8 @@\n from Products.CMFCore.utils import getToolByName\n from zExceptions import BadRequest\n from zope.component.hooks import getSite\n-from zope.interface import alsoProvides, implementer\n+from zope.interface import alsoProvides\n+from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n \n import plone\ndiff --git a/src/plone/restapi/services/history/get.py b/src/plone/restapi/services/history/get.py\nindex cdb5f67b..95f60c99 100644\n--- a/src/plone/restapi/services/history/get.py\n+++ b/src/plone/restapi/services/history/get.py\n@@ -1,14 +1,15 @@\n # -*- coding: utf-8 -*-\n+from datetime import datetime as dt\n from plone.app.layout.viewlets.content import ContentHistoryViewlet\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.serializer.converters import json_compatible\n from plone.restapi.services import Service\n+from Products.CMFPlone.utils import safe_unicode\n from zope.component import queryMultiAdapter\n from zope.component.hooks import getSite\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n-from Products.CMFPlone.utils import safe_unicode\n-from datetime import datetime as dt\n+\n import six\n \n \ndiff --git a/src/plone/restapi/services/history/patch.py b/src/plone/restapi/services/history/patch.py\nindex fe8cf314..9e795407 100644\n--- a/src/plone/restapi/services/history/patch.py\n+++ b/src/plone/restapi/services/history/patch.py\n@@ -1,11 +1,12 @@\n # -*- coding: utf-8 -*-\n+from plone.restapi.deserializer import json_body\n from plone.restapi.serializer.converters import json_compatible\n from plone.restapi.services import Service\n-from plone.restapi.deserializer import json_body\n-from zExceptions import BadRequest\n from Products.CMFCore.utils import getToolByName\n from Products.CMFEditions import CMFEditionsMessageFactory as _\n from Products.CMFEditions.interfaces.IModifier import FileTooLargeToVersionError # noqa\n+from zExceptions import BadRequest\n+\n import six\n \n \ndiff --git a/src/plone/restapi/services/navigation/get.py b/src/plone/restapi/services/navigation/get.py\nindex 3bcc0d1e..e3fbedda 100644\n--- a/src/plone/restapi/services/navigation/get.py\n+++ b/src/plone/restapi/services/navigation/get.py\n@@ -1,15 +1,15 @@\n # -*- coding: utf-8 -*-\n+from plone.app.layout.navigation.navtree import buildFolderTree\n+from plone.app.layout.navigation.root import getNavigationRoot\n from plone.restapi.interfaces import IExpandableElement\n from plone.restapi.services import Service\n-from zope.component import adapter\n-from zope.component import getMultiAdapter\n-from zope.interface import Interface\n-from zope.interface import implementer\n from Products.CMFPlone.browser.navtree import NavtreeQueryBuilder\n-from plone.app.layout.navigation.navtree import buildFolderTree\n-from plone.app.layout.navigation.root import getNavigationRoot\n from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy\n+from zope.component import adapter\n+from zope.component import getMultiAdapter\n from zope.component.hooks import getSite\n+from zope.interface import implementer\n+from zope.interface import Interface\n \n \n class NavigationTreeQueryBuilder(NavtreeQueryBuilder):\ndiff --git a/src/plone/restapi/services/registry/get.py b/src/plone/restapi/services/registry/get.py\nindex 649ff88d..cf39a82f 100644\n--- a/src/plone/restapi/services/registry/get.py\n+++ b/src/plone/restapi/services/registry/get.py\n@@ -1,10 +1,11 @@\n # -*- coding: utf-8 -*-\n from plone.registry.interfaces import IRegistry\n+from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.services import Service\n-from zope.component import getUtility, getMultiAdapter\n+from zope.component import getMultiAdapter\n+from zope.component import getUtility\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n-from plone.restapi.interfaces import ISerializeToJson\n \n \n @implementer(IPublishTraverse)\ndiff --git a/src/plone/restapi/services/tiles/get.py b/src/plone/restapi/services/tiles/get.py\nindex bc2541da..06549945 100644\n--- a/src/plone/restapi/services/tiles/get.py\n+++ b/src/plone/restapi/services/tiles/get.py\n@@ -1,14 +1,14 @@\n # -*- coding: utf-8 -*-\n-from plone.restapi.services import Service\n from AccessControl.security import checkPermission\n-from zope.component import getUtilitiesFor\n-from zope.component import getMultiAdapter\n-from plone.tiles.interfaces import ITileType\n-from plone.restapi.interfaces import ISerializeToJsonSummary\n from plone.restapi.interfaces import ISerializeToJson\n+from plone.restapi.interfaces import ISerializeToJsonSummary\n+from plone.restapi.services import Service\n+from plone.tiles.interfaces import ITileType\n+from zope.component import getMultiAdapter\n+from zope.component import getUtilitiesFor\n+from zope.component import getUtility\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n-from zope.component import getUtility\n \n \n @implementer(IPublishTraverse)\ndiff --git a/src/plone/restapi/services/users/add.py b/src/plone/restapi/services/users/add.py\nindex 6faf296e..9c213ffb 100644\n--- a/src/plone/restapi/services/users/add.py\n+++ b/src/plone/restapi/services/users/add.py\n@@ -19,6 +19,7 @@\n \n import plone.protect.interfaces\n \n+\n try: # pragma: no cover\n from Products.CMFPlone.interfaces import ISecuritySchema\n except ImportError: # pragma: no cover\ndiff --git a/src/plone/restapi/services/users/get.py b/src/plone/restapi/services/users/get.py\nindex d548ca71..734bce7a 100644\n--- a/src/plone/restapi/services/users/get.py\n+++ b/src/plone/restapi/services/users/get.py\n@@ -4,11 +4,12 @@\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n from zExceptions import BadRequest\n-from zope.component.hooks import getSite\n from zope.component import queryMultiAdapter\n+from zope.component.hooks import getSite\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n \n+\n DEFAULT_SEARCH_RESULTS_LIMIT = 25\n \n \ndiff --git a/src/plone/restapi/services/vocabularies/get.py b/src/plone/restapi/services/vocabularies/get.py\nindex 3ebe5abe..3a51519f 100644\n--- a/src/plone/restapi/services/vocabularies/get.py\n+++ b/src/plone/restapi/services/vocabularies/get.py\n@@ -3,11 +3,11 @@\n from plone.restapi.services import Service\n from zope.component import ComponentLookupError\n from zope.component import getMultiAdapter\n+from zope.component import getUtilitiesFor\n from zope.component import getUtility\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n from zope.schema.interfaces import IVocabularyFactory\n-from zope.component import getUtilitiesFor\n \n \n @implementer(IPublishTraverse)\ndiff --git a/src/plone/restapi/services/workflow/info.py b/src/plone/restapi/services/workflow/info.py\nindex 13b828b8..be6b3305 100644\n--- a/src/plone/restapi/services/workflow/info.py\n+++ b/src/plone/restapi/services/workflow/info.py\n@@ -1,14 +1,15 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.WorkflowCore import WorkflowException\n-from Products.CMFCore.utils import getToolByName\n-from Products.CMFCore.interfaces._content import IWorkflowAware\n-from Products.CMFPlone.interfaces import IPloneSiteRoot\n from plone.restapi.interfaces import IExpandableElement\n from plone.restapi.serializer.converters import json_compatible\n from plone.restapi.services import Service\n+from Products.CMFCore.interfaces._content import IWorkflowAware\n+from Products.CMFCore.utils import getToolByName\n+from Products.CMFCore.WorkflowCore import WorkflowException\n+from Products.CMFPlone.interfaces import IPloneSiteRoot\n from zope.component import adapter\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n+\n import six\n \n \ndiff --git a/src/plone/restapi/services/workflow/transition.py b/src/plone/restapi/services/workflow/transition.py\nindex 4897b03d..307de026 100644\n--- a/src/plone/restapi/services/workflow/transition.py\n+++ b/src/plone/restapi/services/workflow/transition.py\n@@ -1,7 +1,6 @@\n # -*- coding: utf-8 -*-\n \n-import six\n-\n+from DateTime import DateTime\n from plone.restapi.deserializer import json_body\n from plone.restapi.interfaces import IDeserializeFromJson\n from plone.restapi.serializer.converters import json_compatible\n@@ -16,9 +15,9 @@\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n from zope.publisher.interfaces import NotFound\n-from DateTime import DateTime\n \n import plone.protect.interfaces\n+import six\n \n \n @implementer(IPublishTraverse)\ndiff --git a/src/plone/restapi/setuphandlers.py b/src/plone/restapi/setuphandlers.py\nindex aaaf2165..a948b3d1 100644\n--- a/src/plone/restapi/setuphandlers.py\n+++ b/src/plone/restapi/setuphandlers.py\n@@ -4,9 +4,7 @@\n from plone.restapi.pas.plugin import JWTAuthenticationPlugin\n from Products.CMFCore.utils import getToolByName\n from Products.CMFPlone.interfaces import INonInstallable\n-from Products.PluggableAuthService.interfaces.authservice import (\n- IPluggableAuthService,\n-) # noqa: E501\n+from Products.PluggableAuthService.interfaces.authservice import IPluggableAuthService # noqa: E501\n from zope.interface import implementer\n \n \ndiff --git a/src/plone/restapi/tests/attypes.py b/src/plone/restapi/tests/attypes.py\nindex 7a76ba43..1c6f1008 100644\n--- a/src/plone/restapi/tests/attypes.py\n+++ b/src/plone/restapi/tests/attypes.py\n@@ -1,14 +1,15 @@\n # -*- coding: utf-8 -*-\n-from Products.ATContentTypes.content.base import registerATCT\n-from Products.ATContentTypes.content.document import ATDocumentBase\n-from Products.ATContentTypes.content.document import ATDocumentSchema\n-from Products.Archetypes import atapi\n-from Products.CMFCore import permissions\n from plone.app.blob.field import BlobField\n from plone.app.blob.field import FileField\n from plone.app.blob.field import ImageField\n from plone.app.folder.folder import ATFolder\n from plone.app.folder.folder import ATFolderSchema\n+from Products.Archetypes import atapi\n+from Products.ATContentTypes.content.base import registerATCT\n+from Products.ATContentTypes.content.document import ATDocumentBase\n+from Products.ATContentTypes.content.document import ATDocumentSchema\n+from Products.CMFCore import permissions\n+\n \n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\ndiff --git a/src/plone/restapi/tests/dxtypes.py b/src/plone/restapi/tests/dxtypes.py\nindex e4f7c301..34c2a026 100644\n--- a/src/plone/restapi/tests/dxtypes.py\n+++ b/src/plone/restapi/tests/dxtypes.py\n@@ -1,5 +1,4 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n from datetime import datetime\n from datetime import time\n from datetime import timedelta\n@@ -11,6 +10,7 @@\n from plone.dexterity.content import Item\n from plone.namedfile import field as namedfile\n from plone.supermodel import model\n+from Products.CMFCore.utils import getToolByName\n from pytz import timezone\n from z3c.relationfield.schema import RelationChoice\n from z3c.relationfield.schema import RelationList\ndiff --git a/src/plone/restapi/tests/mixin_ordering.py b/src/plone/restapi/tests/mixin_ordering.py\nindex 240f0137..365eff43 100644\n--- a/src/plone/restapi/tests/mixin_ordering.py\n+++ b/src/plone/restapi/tests/mixin_ordering.py\n@@ -1,8 +1,8 @@\n # -*- coding: utf-8 -*-\n-import json\n-\n from zExceptions import BadRequest\n \n+import json\n+\n \n class OrderingMixin:\n # This assumes there is a self.folder with 9 documents in it.\ndiff --git a/src/plone/restapi/tests/performance.py b/src/plone/restapi/tests/performance.py\nindex 776064aa..75ee3c28 100644\n--- a/src/plone/restapi/tests/performance.py\n+++ b/src/plone/restapi/tests/performance.py\n@@ -1,13 +1,14 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n-from zope.component.hooks import getSite\n from datetime import datetime\n from plone.app.textfield.value import RichTextValue\n from plone.dexterity.interfaces import IDexterityContent\n+from Products.CMFCore.utils import getToolByName\n+from six.moves import range\n+from zope.component.hooks import getSite\n \n import os\n import pytz\n-from six.moves import range\n+\n \n LOREMIPSUM_HTML_10_PARAGRAPHS = """

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.

Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.""" # noqa\n \ndiff --git a/src/plone/restapi/tests/test_atcollection.py b/src/plone/restapi/tests/test_atcollection.py\nindex f155aa8a..7285535b 100644\n--- a/src/plone/restapi/tests/test_atcollection.py\n+++ b/src/plone/restapi/tests/test_atcollection.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n from DateTime import DateTime\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import setRoles\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.testing import HAS_AT\n from plone.restapi.testing import PLONE_RESTAPI_AT_INTEGRATION_TESTING\ndiff --git a/src/plone/restapi/tests/test_atcontent_deserializer.py b/src/plone/restapi/tests/test_atcontent_deserializer.py\nindex aee241d8..49970e44 100644\n--- a/src/plone/restapi/tests/test_atcontent_deserializer.py\n+++ b/src/plone/restapi/tests/test_atcontent_deserializer.py\n@@ -1,19 +1,20 @@\n # -*- coding: utf-8 -*-\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import setRoles\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.interfaces import IDeserializeFromJson\n from plone.restapi.testing import HAS_AT\n from plone.restapi.testing import PLONE_RESTAPI_AT_INTEGRATION_TESTING\n from plone.restapi.tests.mixin_ordering import OrderingMixin\n+from six.moves import range\n from zExceptions import BadRequest\n+from zope.component import adapter\n from zope.component import getMultiAdapter\n from zope.component import provideHandler\n from zope.component import provideSubscriptionAdapter\n-from zope.component import adapter\n from zope.interface import implementer\n \n import unittest\n-from six.moves import range\n+\n \n if HAS_AT:\n from plone.restapi.deserializer.atcontent import ValidationRequest\ndiff --git a/src/plone/restapi/tests/test_atcontent_serializer.py b/src/plone/restapi/tests/test_atcontent_serializer.py\nindex 407e333b..75590a56 100644\n--- a/src/plone/restapi/tests/test_atcontent_serializer.py\n+++ b/src/plone/restapi/tests/test_atcontent_serializer.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n from DateTime import DateTime\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import setRoles\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.interfaces import IExpandableElement\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.testing import HAS_AT\ndiff --git a/src/plone/restapi/tests/test_atfield_deserializer.py b/src/plone/restapi/tests/test_atfield_deserializer.py\nindex 3e880f66..ed3ae4bb 100644\n--- a/src/plone/restapi/tests/test_atfield_deserializer.py\n+++ b/src/plone/restapi/tests/test_atfield_deserializer.py\n@@ -1,13 +1,13 @@\n # -*- coding: utf-8 -*-\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import setRoles\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.interfaces import IFieldDeserializer\n from plone.restapi.testing import HAS_AT\n from plone.restapi.testing import PLONE_RESTAPI_AT_INTEGRATION_TESTING\n from zope.component import getMultiAdapter\n \n-import unittest\n import six\n+import unittest\n \n \n class TestATFieldDeserializer(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_atfield_serializer.py b/src/plone/restapi/tests/test_atfield_serializer.py\nindex 6ca6fa28..6f769319 100644\n--- a/src/plone/restapi/tests/test_atfield_serializer.py\n+++ b/src/plone/restapi/tests/test_atfield_serializer.py\n@@ -11,8 +11,9 @@\n from zope.component import getMultiAdapter\n \n import os\n-import unittest\n import six\n+import unittest\n+\n \n if PLONE_VERSION.base_version >= "5.1":\n GIF_SCALE_FORMAT = "png"\ndiff --git a/src/plone/restapi/tests/test_auth.py b/src/plone/restapi/tests/test_auth.py\nindex f66cda27..01e602e2 100644\n--- a/src/plone/restapi/tests/test_auth.py\n+++ b/src/plone/restapi/tests/test_auth.py\n@@ -1,12 +1,12 @@\n # -*- coding: utf-8 -*-\n-from ZPublisher.pubevents import PubStart\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.restapi.permissions import UseRESTAPI\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from unittest import TestCase\n-from zope.event import notify\n from zExceptions import Unauthorized\n+from zope.event import notify\n+from ZPublisher.pubevents import PubStart\n \n \n class TestLogin(TestCase):\ndiff --git a/src/plone/restapi/tests/test_batching.py b/src/plone/restapi/tests/test_batching.py\nindex 9159aa72..006511a7 100644\n--- a/src/plone/restapi/tests/test_batching.py\n+++ b/src/plone/restapi/tests/test_batching.py\n@@ -13,12 +13,12 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from plone.restapi.testing import RelativeSession\n from plone.restapi.tests.helpers import result_paths\n+from six.moves import range\n from six.moves.urllib.parse import parse_qsl\n from six.moves.urllib.parse import urlparse\n \n import transaction\n import unittest\n-from six.moves import range\n \n \n class TestBatchingDXBase(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_boolean_value.py b/src/plone/restapi/tests/test_boolean_value.py\nindex 72c308c0..b3fbee36 100644\n--- a/src/plone/restapi/tests/test_boolean_value.py\n+++ b/src/plone/restapi/tests/test_boolean_value.py\n@@ -1,9 +1,9 @@\n # -*- coding: utf-8 -*-\n-import unittest\n-\n from plone.restapi.deserializer import boolean_value\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n \n+import unittest\n+\n \n class TestBooleanValue(unittest.TestCase):\n \ndiff --git a/src/plone/restapi/tests/test_comments.py b/src/plone/restapi/tests/test_comments.py\nindex 64cfdb20..bc4622bb 100644\n--- a/src/plone/restapi/tests/test_comments.py\n+++ b/src/plone/restapi/tests/test_comments.py\n@@ -1,19 +1,16 @@\n # -*- coding: utf-8 -*-\n-from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n-from unittest import TestCase\n-from zope.component import getMultiAdapter\n-\n-from plone.restapi.interfaces import ISerializeToJson\n-from plone.app.discussion.interfaces import IDiscussionSettings\n+from plone import api\n from plone.app.discussion.interfaces import IConversation\n+from plone.app.discussion.interfaces import IDiscussionSettings\n from plone.app.discussion.interfaces import IReplies\n from plone.registry.interfaces import IRegistry\n-\n+from plone.restapi.interfaces import ISerializeToJson\n+from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n+from unittest import TestCase\n from zope.component import createObject\n+from zope.component import getMultiAdapter\n from zope.component import getUtility\n \n-from plone import api\n-\n \n class TestCommentsSerializers(TestCase):\n layer = PLONE_RESTAPI_DX_INTEGRATION_TESTING\ndiff --git a/src/plone/restapi/tests/test_content_delete.py b/src/plone/restapi/tests/test_content_delete.py\nindex fdaab9fd..8305acde 100644\n--- a/src/plone/restapi/tests/test_content_delete.py\n+++ b/src/plone/restapi/tests/test_content_delete.py\n@@ -1,24 +1,25 @@\n # -*- coding: utf-8 -*-\n-from ZPublisher.pubevents import PubStart\n from base64 import b64encode\n from pkg_resources import get_distribution\n from pkg_resources import parse_version\n+from plone.app.testing import login\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n from plone.app.testing import TEST_USER_NAME\n from plone.app.testing import TEST_USER_PASSWORD\n-from plone.app.testing import login\n-from plone.app.testing import setRoles\n from plone.restapi.testing import HAS_AT\n from plone.restapi.testing import PLONE_RESTAPI_AT_INTEGRATION_TESTING\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from zope.event import notify\n+from ZPublisher.pubevents import PubStart\n \n import requests\n import transaction\n import unittest\n \n+\n linkintegrity_version = get_distribution("plone.app.linkintegrity").version\n if parse_version(linkintegrity_version) >= parse_version("3.0.dev0"):\n NEW_LINKINTEGRITY = True\ndiff --git a/src/plone/restapi/tests/test_content_get.py b/src/plone/restapi/tests/test_content_get.py\nindex 3c38c829..d87ed540 100644\n--- a/src/plone/restapi/tests/test_content_get.py\n+++ b/src/plone/restapi/tests/test_content_get.py\n@@ -1,14 +1,14 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n+from plone.app.testing import login\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n-from plone.app.testing import login\n-from plone.app.testing import setRoles\n from plone.app.textfield.value import RichTextValue\n from plone.restapi.testing import HAS_AT\n from plone.restapi.testing import PLONE_RESTAPI_AT_FUNCTIONAL_TESTING\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n+from Products.CMFCore.utils import getToolByName\n from z3c.relationfield import RelationValue\n from zope.component import getUtility\n from zope.intid.interfaces import IIntIds\ndiff --git a/src/plone/restapi/tests/test_content_local_roles.py b/src/plone/restapi/tests/test_content_local_roles.py\nindex 608498e4..9e827929 100644\n--- a/src/plone/restapi/tests/test_content_local_roles.py\n+++ b/src/plone/restapi/tests/test_content_local_roles.py\n@@ -1,14 +1,14 @@\n # -*- coding: utf-8 -*-\n from Acquisition import aq_base\n-from Products.CMFCore.utils import getToolByName\n from plone import api\n+from plone.app.testing import login\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n-from plone.app.testing import login\n-from plone.app.testing import setRoles\n from plone.restapi.serializer.local_roles import SerializeLocalRolesToJson\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n+from Products.CMFCore.utils import getToolByName\n from zope.component import getGlobalSiteManager\n \n import requests\ndiff --git a/src/plone/restapi/tests/test_copymove.py b/src/plone/restapi/tests/test_copymove.py\nindex 8c610347..0a03089a 100644\n--- a/src/plone/restapi/tests/test_copymove.py\n+++ b/src/plone/restapi/tests/test_copymove.py\n@@ -1,18 +1,18 @@\n # -*- coding: utf-8 -*-\n-from plone import api\n-from ZPublisher.pubevents import PubStart\n from base64 import b64encode\n+from plone import api\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n-from plone.app.testing import setRoles\n-from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n+from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from plone.restapi.testing import RelativeSession\n from zope.event import notify\n+from ZPublisher.pubevents import PubStart\n \n-import unittest\n import transaction\n+import unittest\n \n \n class TestCopyMove(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_documentation.py b/src/plone/restapi/tests/test_documentation.py\nindex b18064b9..a9bda9ff 100644\n--- a/src/plone/restapi/tests/test_documentation.py\n+++ b/src/plone/restapi/tests/test_documentation.py\n@@ -1,8 +1,8 @@\n # -*- coding: utf-8 -*-\n from base64 import b64encode\n from datetime import datetime\n-from DateTime import DateTime\n from datetime import timedelta\n+from DateTime import DateTime\n from freezegun import freeze_time\n from mock import patch\n from pkg_resources import parse_version\n@@ -24,15 +24,14 @@\n from plone.namedfile.file import NamedBlobFile\n from plone.namedfile.file import NamedBlobImage\n from plone.registry.interfaces import IRegistry\n-from plone.restapi.testing import PAM_INSTALLED\n+from plone.restapi.testing import PAM_INSTALLED # noqa\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING_FREEZETIME # noqa\n-from plone.restapi.testing import (\n- PLONE_RESTAPI_DX_PAM_FUNCTIONAL_TESTING_FREEZETIME,\n-) # noqa\n+from plone.restapi.testing import PLONE_RESTAPI_DX_PAM_FUNCTIONAL_TESTING_FREEZETIME\n from plone.restapi.testing import register_static_uuid_utility\n from plone.restapi.testing import RelativeSession\n from plone.scale import storage\n from plone.testing.z2 import Browser\n+from six.moves import range\n from zope.component import createObject\n from zope.component import getUtility\n from zope.interface import alsoProvides\n@@ -45,7 +44,7 @@\n import six\n import transaction\n import unittest\n-from six.moves import range\n+\n \n if PAM_INSTALLED:\n from plone.app.multilingual.interfaces import ITranslationManager\ndiff --git a/src/plone/restapi/tests/test_dxcontent_deserializer.py b/src/plone/restapi/tests/test_dxcontent_deserializer.py\nindex 223dbfdc..d80c5f71 100644\n--- a/src/plone/restapi/tests/test_dxcontent_deserializer.py\n+++ b/src/plone/restapi/tests/test_dxcontent_deserializer.py\n@@ -1,6 +1,6 @@\n # -*- coding: utf-8 -*-\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import setRoles\n+from plone.app.testing import TEST_USER_ID\n from plone.dexterity.interfaces import IDexterityItem\n from plone.restapi.exceptions import DeserializationError\n from plone.restapi.interfaces import IDeserializeFromJson\n@@ -8,15 +8,15 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from plone.restapi.tests.dxtypes import ITestAnnotationsBehavior\n from plone.restapi.tests.mixin_ordering import OrderingMixin\n+from six.moves import range\n from zExceptions import BadRequest\n from zope.component import getMultiAdapter\n from zope.component import provideHandler\n from zope.lifecycleevent.interfaces import IObjectModifiedEvent\n \n import json\n-import unittest\n import six\n-from six.moves import range\n+import unittest\n \n \n class TestDXContentDeserializer(unittest.TestCase, OrderingMixin):\ndiff --git a/src/plone/restapi/tests/test_dxcontent_serializer.py b/src/plone/restapi/tests/test_dxcontent_serializer.py\nindex 7382ba83..301b0e00 100644\n--- a/src/plone/restapi/tests/test_dxcontent_serializer.py\n+++ b/src/plone/restapi/tests/test_dxcontent_serializer.py\n@@ -1,9 +1,9 @@\n # -*- coding: utf-8 -*-\n-from DateTime import DateTime\n from datetime import date\n from datetime import datetime\n from datetime import time\n from datetime import timedelta\n+from DateTime import DateTime\n from plone.app.discussion.interfaces import IDiscussionSettings\n from plone.app.testing import setRoles\n from plone.app.testing import TEST_USER_ID\ndiff --git a/src/plone/restapi/tests/test_dxfield_deserializer.py b/src/plone/restapi/tests/test_dxfield_deserializer.py\nindex 27711f79..cb12aa16 100644\n--- a/src/plone/restapi/tests/test_dxfield_deserializer.py\n+++ b/src/plone/restapi/tests/test_dxfield_deserializer.py\n@@ -9,17 +9,16 @@\n from plone.dexterity.utils import iterSchemata\n from plone.restapi.interfaces import IFieldDeserializer\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n-from pytz import timezone\n-\n from plone.restapi.tests.dxtypes import IDXTestDocumentSchema\n+from pytz import timezone\n from zope.component import getMultiAdapter\n-from zope.schema.interfaces import ConstraintNotSatisfied\n from zope.schema import Field\n from zope.schema._bootstrapinterfaces import RequiredMissing\n+from zope.schema.interfaces import ConstraintNotSatisfied\n from zope.schema.interfaces import ValidationError\n \n-import unittest\n import six\n+import unittest\n \n \n class RequiredField(object):\ndiff --git a/src/plone/restapi/tests/test_dxfield_serializer.py b/src/plone/restapi/tests/test_dxfield_serializer.py\nindex 04edd751..cd6b04f1 100644\n--- a/src/plone/restapi/tests/test_dxfield_serializer.py\n+++ b/src/plone/restapi/tests/test_dxfield_serializer.py\n@@ -23,6 +23,7 @@\n import os\n import six\n \n+\n if PLONE_VERSION.base_version >= "5.1":\n GIF_SCALE_FORMAT = "png"\n else:\ndiff --git a/src/plone/restapi/tests/test_error_handling.py b/src/plone/restapi/tests/test_error_handling.py\nindex 37cca4d8..f6852341 100644\n--- a/src/plone/restapi/tests/test_error_handling.py\n+++ b/src/plone/restapi/tests/test_error_handling.py\n@@ -1,8 +1,8 @@\n # -*- coding: utf-8 -*-\n from plone.app.testing import setRoles\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n from Products.Five.browser import BrowserView\ndiff --git a/src/plone/restapi/tests/test_expansion.py b/src/plone/restapi/tests/test_expansion.py\nindex e372be25..13274ab7 100644\n--- a/src/plone/restapi/tests/test_expansion.py\n+++ b/src/plone/restapi/tests/test_expansion.py\n@@ -21,6 +21,7 @@\n import transaction\n import unittest\n \n+\n if PAM_INSTALLED:\n from plone.app.multilingual.interfaces import IPloneAppMultilingualInstalled # noqa\n from plone.app.multilingual.interfaces import ITranslationManager\ndiff --git a/src/plone/restapi/tests/test_functional_auth.py b/src/plone/restapi/tests/test_functional_auth.py\nindex 9a9972a1..98bda6eb 100644\n--- a/src/plone/restapi/tests/test_functional_auth.py\n+++ b/src/plone/restapi/tests/test_functional_auth.py\n@@ -1,10 +1,10 @@\n # -*- coding: utf-8 -*-\n+from plone.app.testing import login\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import TEST_USER_ID\n from plone.app.testing import TEST_USER_NAME\n from plone.app.testing import TEST_USER_PASSWORD\n-from plone.app.testing import login\n-from plone.app.testing import setRoles\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n \n import requests\ndiff --git a/src/plone/restapi/tests/test_locking.py b/src/plone/restapi/tests/test_locking.py\nindex c738dca4..9d699b06 100644\n--- a/src/plone/restapi/tests/test_locking.py\n+++ b/src/plone/restapi/tests/test_locking.py\n@@ -1,17 +1,16 @@\n # -*- coding: utf-8 -*-\n+from plone.app.testing import login\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n-from plone.app.testing import login\n+from plone.locking.interfaces import ILockable\n+from plone.locking.interfaces import INonStealableLock\n from plone.locking.interfaces import ITTWLockable\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n from zope.interface import alsoProvides\n-from plone.locking.interfaces import ILockable\n-from plone.locking.interfaces import INonStealableLock\n-\n \n-import unittest\n import transaction\n+import unittest\n \n \n class TestLocking(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_pas.py b/src/plone/restapi/tests/test_pas.py\nindex a9a2f7ae..822216c7 100644\n--- a/src/plone/restapi/tests/test_pas.py\n+++ b/src/plone/restapi/tests/test_pas.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n from plone.keyring.interfaces import IKeyManager\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n+from Products.CMFCore.utils import getToolByName\n from zope.component import getUtility\n \n import unittest\ndiff --git a/src/plone/restapi/tests/test_permissions.py b/src/plone/restapi/tests/test_permissions.py\nindex 80fe21f2..bb381db4 100644\n--- a/src/plone/restapi/tests/test_permissions.py\n+++ b/src/plone/restapi/tests/test_permissions.py\n@@ -7,8 +7,8 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n \n-import unittest\n import transaction\n+import unittest\n \n \n class TestPermissions(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_profile_tiles.py b/src/plone/restapi/tests/test_profile_tiles.py\nindex 8875cf07..22748ff3 100644\n--- a/src/plone/restapi/tests/test_profile_tiles.py\n+++ b/src/plone/restapi/tests/test_profile_tiles.py\n@@ -1,10 +1,10 @@\n # -*- coding: utf-8 -*-\n-from plone.app.testing import SITE_OWNER_NAME\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import login\n from plone.app.testing import setRoles\n-from plone.restapi.testing import PLONE_RESTAPI_TILES_INTEGRATION_TESTING\n+from plone.app.testing import SITE_OWNER_NAME\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.behaviors import ITiles\n+from plone.restapi.testing import PLONE_RESTAPI_TILES_INTEGRATION_TESTING\n from Products.CMFCore.utils import getToolByName\n \n import unittest\ndiff --git a/src/plone/restapi/tests/test_query_parsers.py b/src/plone/restapi/tests/test_query_parsers.py\nindex c3369614..fcd55afb 100644\n--- a/src/plone/restapi/tests/test_query_parsers.py\n+++ b/src/plone/restapi/tests/test_query_parsers.py\n@@ -10,6 +10,7 @@\n from plone.restapi.search.query import KeywordIndexQueryParser\n from plone.restapi.search.query import UUIDIndexQueryParser\n from plone.restapi.search.query import ZCTextIndexQueryParser\n+\n import unittest\n \n \ndiff --git a/src/plone/restapi/tests/test_registry.py b/src/plone/restapi/tests/test_registry.py\nindex 3f76ba74..14b1803c 100644\n--- a/src/plone/restapi/tests/test_registry.py\n+++ b/src/plone/restapi/tests/test_registry.py\n@@ -8,11 +8,11 @@\n from plone.registry.record import Record\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n+from six.moves import range\n from zope.component import getUtility\n \n import transaction\n import unittest\n-from six.moves import range\n \n \n class TestRegistry(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_registry_serializer.py b/src/plone/restapi/tests/test_registry_serializer.py\nindex 76b0e769..b4f2065c 100644\n--- a/src/plone/restapi/tests/test_registry_serializer.py\n+++ b/src/plone/restapi/tests/test_registry_serializer.py\n@@ -1,14 +1,14 @@\n # -*- coding: utf-8 -*-\n-from plone.registry import Registry\n from plone.registry import field\n+from plone.registry import Registry\n from plone.registry.record import Record\n from plone.restapi import HAS_AT\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.testing import PLONE_RESTAPI_AT_INTEGRATION_TESTING\n+from six.moves import range\n from zope.component import getMultiAdapter\n \n import unittest\n-from six.moves import range\n \n \n class TestRegistrySerializer(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_serializer_converters.py b/src/plone/restapi/tests/test_serializer_converters.py\nindex d53d5dec..55530680 100644\n--- a/src/plone/restapi/tests/test_serializer_converters.py\n+++ b/src/plone/restapi/tests/test_serializer_converters.py\n@@ -1,8 +1,8 @@\n # -*- coding: utf-8 -*-\n from datetime import date\n-from DateTime import DateTime\n from datetime import time\n from datetime import timedelta\n+from DateTime import DateTime\n from persistent.list import PersistentList\n from persistent.mapping import PersistentMapping\n from plone.restapi.serializer.converters import json_compatible\ndiff --git a/src/plone/restapi/tests/test_services.py b/src/plone/restapi/tests/test_services.py\nindex 4b630309..68d58637 100644\n--- a/src/plone/restapi/tests/test_services.py\n+++ b/src/plone/restapi/tests/test_services.py\n@@ -14,9 +14,9 @@\n from zope.component import getUtility\n from zope.intid.interfaces import IIntIds\n \n-import unittest\n import os\n import transaction\n+import unittest\n \n \n class TestTraversal(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_services_actions.py b/src/plone/restapi/tests/test_services_actions.py\nindex 5a16a7b6..21dc8a27 100644\n--- a/src/plone/restapi/tests/test_services_actions.py\n+++ b/src/plone/restapi/tests/test_services_actions.py\n@@ -1,7 +1,4 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.ActionInformation import Action\n-from Products.CMFCore.ActionInformation import ActionCategory\n-from Products.CMFCore import permissions\n from plone import api\n from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n@@ -9,6 +6,9 @@\n from plone.app.testing import TEST_USER_ID\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n+from Products.CMFCore import permissions\n+from Products.CMFCore.ActionInformation import Action\n+from Products.CMFCore.ActionInformation import ActionCategory\n \n import transaction\n import unittest\ndiff --git a/src/plone/restapi/tests/test_services_comments.py b/src/plone/restapi/tests/test_services_comments.py\nindex 4a8e134f..0243acae 100644\n--- a/src/plone/restapi/tests/test_services_comments.py\n+++ b/src/plone/restapi/tests/test_services_comments.py\n@@ -1,13 +1,11 @@\n # -*- coding: utf-8 -*-\n from plone import api\n+from plone.app.discussion.interfaces import IDiscussionSettings\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.registry.interfaces import IRegistry\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n-\n-from plone.app.discussion.interfaces import IDiscussionSettings\n-\n from zope.component import getUtility\n \n import transaction\ndiff --git a/src/plone/restapi/tests/test_services_content.py b/src/plone/restapi/tests/test_services_content.py\nindex fe6ba842..23fb7891 100644\n--- a/src/plone/restapi/tests/test_services_content.py\n+++ b/src/plone/restapi/tests/test_services_content.py\n@@ -1,13 +1,13 @@\n # -*- coding: utf-8 -*-\n-from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n-from plone.restapi.testing import RelativeSession\n from plone.app.testing import setRoles\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n+from plone.app.testing import TEST_USER_ID\n+from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n+from plone.restapi.testing import RelativeSession\n \n-import unittest\n import transaction\n+import unittest\n \n \n class TestHistoryVersioning(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_services_controlpanels.py b/src/plone/restapi/tests/test_services_controlpanels.py\nindex cda2cebc..15c0834d 100644\n--- a/src/plone/restapi/tests/test_services_controlpanels.py\n+++ b/src/plone/restapi/tests/test_services_controlpanels.py\n@@ -8,6 +8,7 @@\n \n import unittest\n \n+\n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\n except ImportError:\ndiff --git a/src/plone/restapi/tests/test_services_email_notification.py b/src/plone/restapi/tests/test_services_email_notification.py\nindex a0b05b80..60a729b1 100644\n--- a/src/plone/restapi/tests/test_services_email_notification.py\n+++ b/src/plone/restapi/tests/test_services_email_notification.py\n@@ -1,18 +1,18 @@\n # -*- coding: utf-8 -*-\n-from Products.MailHost.interfaces import IMailHost\n-\n from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n+from plone.registry.interfaces import IRegistry\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n+from Products.MailHost.interfaces import IMailHost\n from zope.component import getUtility\n-from plone.registry.interfaces import IRegistry\n \n import transaction\n import unittest\n \n+\n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\n except ImportError:\ndiff --git a/src/plone/restapi/tests/test_services_email_send.py b/src/plone/restapi/tests/test_services_email_send.py\nindex 2d24eb01..15669f0a 100644\n--- a/src/plone/restapi/tests/test_services_email_send.py\n+++ b/src/plone/restapi/tests/test_services_email_send.py\n@@ -1,18 +1,18 @@\n # -*- coding: utf-8 -*-\n-from Products.MailHost.interfaces import IMailHost\n-\n from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n+from plone.registry.interfaces import IRegistry\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n+from Products.MailHost.interfaces import IMailHost\n from zope.component import getUtility\n-from plone.registry.interfaces import IRegistry\n \n import transaction\n import unittest\n \n+\n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\n except ImportError:\ndiff --git a/src/plone/restapi/tests/test_services_history.py b/src/plone/restapi/tests/test_services_history.py\nindex e4d2f0e8..a3ade88c 100644\n--- a/src/plone/restapi/tests/test_services_history.py\n+++ b/src/plone/restapi/tests/test_services_history.py\n@@ -7,9 +7,9 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n \n-import unittest\n-import transaction\n import six\n+import transaction\n+import unittest\n \n \n class TestHistoryEndpoint(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_services_types.py b/src/plone/restapi/tests/test_services_types.py\nindex 9ef8357c..388b82b1 100644\n--- a/src/plone/restapi/tests/test_services_types.py\n+++ b/src/plone/restapi/tests/test_services_types.py\n@@ -7,7 +7,6 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n \n-\n import transaction\n import unittest\n \ndiff --git a/src/plone/restapi/tests/test_services_users.py b/src/plone/restapi/tests/test_services_users.py\nindex 186f067b..cba88a5f 100644\n--- a/src/plone/restapi/tests/test_services_users.py\n+++ b/src/plone/restapi/tests/test_services_users.py\n@@ -1,8 +1,4 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.permissions import SetOwnPassword\n-from Products.CMFCore.utils import getToolByName\n-from Products.MailHost.interfaces import IMailHost\n-\n from plone import api\n from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n@@ -10,16 +6,21 @@\n from plone.app.testing import TEST_USER_ID\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n+from Products.CMFCore.permissions import SetOwnPassword\n+from Products.CMFCore.utils import getToolByName\n+from Products.MailHost.interfaces import IMailHost\n from zope.component import getAdapter\n from zope.component import getUtility\n \n+import transaction\n+import unittest\n+\n+\n try:\n from Products.CMFPlone.interfaces import ISecuritySchema\n except ImportError:\n from plone.app.controlpanel.security import ISecuritySchema\n \n-import transaction\n-import unittest\n \n \n class TestUsersEndpoint(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_services_vocabularies.py b/src/plone/restapi/tests/test_services_vocabularies.py\nindex 3110f70f..9208712f 100644\n--- a/src/plone/restapi/tests/test_services_vocabularies.py\n+++ b/src/plone/restapi/tests/test_services_vocabularies.py\n@@ -10,8 +10,8 @@\n from zope.component import provideUtility\n from zope.componentvocabulary.vocabulary import UtilityTerm\n from zope.schema.interfaces import IVocabularyFactory\n-from zope.schema.vocabulary import SimpleVocabulary\n from zope.schema.vocabulary import SimpleTerm\n+from zope.schema.vocabulary import SimpleVocabulary\n \n import six\n import transaction\ndiff --git a/src/plone/restapi/tests/test_setup.py b/src/plone/restapi/tests/test_setup.py\nindex 5357e39b..b163c978 100644\n--- a/src/plone/restapi/tests/test_setup.py\n+++ b/src/plone/restapi/tests/test_setup.py\n@@ -1,12 +1,12 @@\n # -*- coding: utf-8 -*-\n-import unittest\n-\n-from Products.CMFCore.utils import getToolByName\n-from plone.browserlayer.utils import registered_layers\n-\n from plone import api\n+from plone.browserlayer.utils import registered_layers\n from plone.restapi import PROJECT_NAME\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n+from Products.CMFCore.utils import getToolByName\n+\n+import unittest\n+\n \n try:\n from Products.CMFPlone.utils import get_installer\ndiff --git a/src/plone/restapi/tests/test_site_serializer.py b/src/plone/restapi/tests/test_site_serializer.py\nindex 8e7070a5..e941f1aa 100644\n--- a/src/plone/restapi/tests/test_site_serializer.py\n+++ b/src/plone/restapi/tests/test_site_serializer.py\n@@ -3,7 +3,6 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from zope.component import getMultiAdapter\n \n-\n import json\n import unittest\n \ndiff --git a/src/plone/restapi/tests/test_time_freezing.py b/src/plone/restapi/tests/test_time_freezing.py\nindex a35eff6c..de46fc15 100644\n--- a/src/plone/restapi/tests/test_time_freezing.py\n+++ b/src/plone/restapi/tests/test_time_freezing.py\n@@ -1,5 +1,6 @@\n # -*- coding: utf-8 -*-\n from freezegun import freeze_time\n+\n import freezegun\n import time\n import unittest\ndiff --git a/src/plone/restapi/tests/test_tus.py b/src/plone/restapi/tests/test_tus.py\nindex 08aca316..ee63d46b 100644\n--- a/src/plone/restapi/tests/test_tus.py\n+++ b/src/plone/restapi/tests/test_tus.py\n@@ -32,6 +32,7 @@\n import transaction\n import unittest\n \n+\n UPLOAD_DATA = b"abcdefgh"\n UPLOAD_MIMETYPE = "text/plain"\n UPLOAD_FILENAME = "test.txt"\ndiff --git a/src/plone/restapi/tests/test_workflow.py b/src/plone/restapi/tests/test_workflow.py\nindex 85b9e278..e29d8735 100644\n--- a/src/plone/restapi/tests/test_workflow.py\n+++ b/src/plone/restapi/tests/test_workflow.py\n@@ -1,20 +1,20 @@\n # -*- coding: utf-8 -*-\n-from DateTime import DateTime\n-from Products.CMFCore.utils import getToolByName\n-from ZPublisher.pubevents import PubStart\n from base64 import b64encode\n+from DateTime import DateTime\n+from plone.app.testing import login\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n from plone.app.testing import TEST_USER_NAME\n-from plone.app.testing import login\n-from plone.app.testing import setRoles\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n+from Products.CMFCore.utils import getToolByName\n from unittest import TestCase\n from zExceptions import NotFound\n from zope.component import getMultiAdapter\n from zope.event import notify\n+from ZPublisher.pubevents import PubStart\n \n \n class TestWorkflowInfo(TestCase):\ndiff --git a/src/plone/restapi/types/adapters.py b/src/plone/restapi/types/adapters.py\nindex 32281cd9..d715202b 100644\n--- a/src/plone/restapi/types/adapters.py\n+++ b/src/plone/restapi/types/adapters.py\n@@ -2,9 +2,10 @@\n """JsonSchema providers."""\n from plone.app.textfield.interfaces import IRichText\n from plone.restapi.types.interfaces import IJsonSchemaProvider\n-from plone.restapi.types.utils import get_fieldsets, get_widget_params\n+from plone.restapi.types.utils import get_fieldsets\n from plone.restapi.types.utils import get_jsonschema_properties\n from plone.restapi.types.utils import get_vocabulary_url\n+from plone.restapi.types.utils import get_widget_params\n from plone.schema import IJSONField\n from zope.component import adapter\n from zope.component import getMultiAdapter\ndiff --git a/src/plone/restapi/types/utils.py b/src/plone/restapi/types/utils.py\nindex 82e2e2dd..e46d5388 100644\n--- a/src/plone/restapi/types/utils.py\n+++ b/src/plone/restapi/types/utils.py\n@@ -21,8 +21,8 @@\n from plone.dexterity.utils import getAdditionalSchemata\n from plone.restapi.serializer.converters import IJsonCompatible\n from plone.restapi.types.interfaces import IJsonSchemaProvider\n-from Products.CMFCore.utils import getToolByName\n from plone.supermodel.utils import mergedTaggedValueDict\n+from Products.CMFCore.utils import getToolByName\n from z3c.form import form as z3c_form\n from zope.component import getMultiAdapter\n from zope.component import queryMultiAdapter\ndiff --git a/src/plone/restapi/types/z3crelationadapter.py b/src/plone/restapi/types/z3crelationadapter.py\nindex 4bba58eb..8a91755f 100644\n--- a/src/plone/restapi/types/z3crelationadapter.py\n+++ b/src/plone/restapi/types/z3crelationadapter.py\n@@ -1,4 +1,5 @@\n # -*- coding: utf-8 -*-\n+from plone.restapi.types.adapters import ListJsonSchemaProvider\n from plone.restapi.types.interfaces import IJsonSchemaProvider\n from z3c.relationfield.interfaces import IRelationList\n from zope.component import adapter\n@@ -6,8 +7,6 @@\n from zope.interface import implementer\n from zope.interface import Interface\n \n-from plone.restapi.types.adapters import ListJsonSchemaProvider\n-\n \n @adapter(IRelationList, Interface, Interface)\n @implementer(IJsonSchemaProvider)\n' - -Repository: plone.restapi - - -Branch: refs/heads/master -Date: 2019-06-22T06:12:53+02:00 -Author: Timo Stollenwerk (tisto) -Commit: https://github.com/plone/plone.restapi/commit/aadcdd786ef53edb815b549bf4456fe71adb3733 - -Merge branch 'master' into isort - -Files changed: -M CHANGES.rst -M setup.py -D news/760.bugfix - -b"diff --git a/CHANGES.rst b/CHANGES.rst\nindex 2e88028d..a074f4fb 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -8,6 +8,15 @@ Changelog\n \n .. towncrier release notes start\n \n+4.1.4 (2019-06-21)\n+------------------\n+\n+Bug fixes:\n+\n+\n+- Set effective_date and reindex obj on workflow transitions. [wkbkhard] (#760)\n+\n+\n 4.1.3 (2019-06-21)\n ------------------\n \ndiff --git a/news/760.bugfix b/news/760.bugfix\ndeleted file mode 100644\nindex 6736bd21..00000000\n--- a/news/760.bugfix\n+++ /dev/null\n@@ -1 +0,0 @@\n-Set effective_date and reindex obj on workflow transitions. [wkbkhard]\n\\ No newline at end of file\ndiff --git a/setup.py b/setup.py\nindex 4c7dc8ad..9439c1d3 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -2,7 +2,7 @@\n \n import sys\n \n-version = '4.1.4.dev0'\n+version = '4.1.5.dev0'\n \n long_description = (\n open('README.rst').read() + '\\n' +\n" - -Repository: plone.restapi - - -Branch: refs/heads/master -Date: 2019-06-22T07:45:31+02:00 -Author: Timo Stollenwerk (tisto) -Commit: https://github.com/plone/plone.restapi/commit/c36112f7c595ed0b48a372fa40a962a7ace7ed97 - -Remove isort, fix black. - -Files changed: -M Makefile -M base.cfg -M src/plone/restapi/__init__.py -M src/plone/restapi/deserializer/atfields.py -M src/plone/restapi/deserializer/relationfield.py -M src/plone/restapi/services/auth/login.py -M src/plone/restapi/services/auth/renew.py -M src/plone/restapi/services/copymove/copymove.py -M src/plone/restapi/services/multilingual/pam.py -M src/plone/restapi/services/navigation/get.py -M src/plone/restapi/services/workflow/transition.py -M src/plone/restapi/setuphandlers.py -M src/plone/restapi/tests/test_services_users.py -M src/plone/restapi/tests/test_time_freezing.py -M src/plone/restapi/tests/test_types.py -M src/plone/restapi/tests/test_workflow.py - -b'diff --git a/Makefile b/Makefile\nindex 60eba0a9..cb1d1abf 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -66,6 +66,7 @@ build-py3: ## Build Plone 5.2 with Python 3\n \tvirtualenv --python=python3 .\n \tbin/pip install --upgrade pip\n \tbin/pip install -r requirements.txt\n+\tbin/pip install black\n \tbin/buildout -c plone-5.2.x.cfg\n \n bin/python bin/pip:\ndiff --git a/base.cfg b/base.cfg\nindex 1ace2299..e9bf2a8a 100644\n--- a/base.cfg\n+++ b/base.cfg\n@@ -107,7 +107,7 @@ flake8-extensions =\n flake8-coding\n flake8-debugger\n flake8-print\n- flake8-isort\n+# flake8-isort\n # additional pep8/flake8 rules, see docs for details\n # https://pep8.readthedocs.io/en/1.4.6/intro.html#error-codes\n # - E123: closing bracket does not match indentation of opening bracket\xe2\x80\x99s line\ndiff --git a/src/plone/restapi/__init__.py b/src/plone/restapi/__init__.py\nindex bf144d63..b3a1526d 100644\n--- a/src/plone/restapi/__init__.py\n+++ b/src/plone/restapi/__init__.py\n@@ -2,7 +2,9 @@\n from AccessControl import allow_module\n from AccessControl.Permissions import add_user_folders\n from plone.restapi.pas import plugin\n-from Products.PluggableAuthService.PluggableAuthService import registerMultiPlugin # noqa\n+from Products.PluggableAuthService.PluggableAuthService import (\n+ registerMultiPlugin,\n+)\n from zope.i18nmessageid import MessageFactory\n \n import pkg_resources\ndiff --git a/src/plone/restapi/deserializer/atfields.py b/src/plone/restapi/deserializer/atfields.py\nindex 2e2ccd05..4e322be0 100644\n--- a/src/plone/restapi/deserializer/atfields.py\n+++ b/src/plone/restapi/deserializer/atfields.py\n@@ -70,7 +70,7 @@ def __call__(self, value):\n for i, v in enumerate(value):\n # Resolve references given by URL\n if v.startswith(portal_url):\n- path = v[len(portal_url) + 1 :].encode("utf8")\n+ path = v[len(portal_url) + 1:].encode("utf8")\n value[i] = portal.unrestrictedTraverse(path, None)\n \n return value, {}\ndiff --git a/src/plone/restapi/deserializer/relationfield.py b/src/plone/restapi/deserializer/relationfield.py\nindex 67c0e913..a313f822 100644\n--- a/src/plone/restapi/deserializer/relationfield.py\n+++ b/src/plone/restapi/deserializer/relationfield.py\n@@ -39,7 +39,7 @@ def __call__(self, value):\n portal_url = portal.absolute_url()\n if value.startswith(portal_url):\n # Resolve by URL\n- obj = portal.restrictedTraverse(value[len(portal_url) + 1 :], None)\n+ obj = portal.restrictedTraverse(value[len(portal_url) + 1:], None)\n resolved_by = "URL"\n elif value.startswith("/"):\n # Resolve by path\ndiff --git a/src/plone/restapi/services/auth/login.py b/src/plone/restapi/services/auth/login.py\nindex 64760248..3937ce65 100644\n--- a/src/plone/restapi/services/auth/login.py\n+++ b/src/plone/restapi/services/auth/login.py\n@@ -4,7 +4,9 @@\n from plone.restapi.deserializer import json_body\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n-from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin # noqa\n+from Products.PluggableAuthService.interfaces.plugins import (\n+ IAuthenticationPlugin,\n+)\n from zope.interface import alsoProvides\n \n import plone.protect.interfaces\ndiff --git a/src/plone/restapi/services/auth/renew.py b/src/plone/restapi/services/auth/renew.py\nindex 7a99e2b9..01362244 100644\n--- a/src/plone/restapi/services/auth/renew.py\n+++ b/src/plone/restapi/services/auth/renew.py\n@@ -1,7 +1,9 @@\n # -*- coding: utf-8 -*-\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n-from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin # noqa\n+from Products.PluggableAuthService.interfaces.plugins import (\n+ IAuthenticationPlugin,\n+) # noqa\n from zope.interface import alsoProvides\n \n import plone.protect.interfaces\ndiff --git a/src/plone/restapi/services/copymove/copymove.py b/src/plone/restapi/services/copymove/copymove.py\nindex 05e9374f..bfa11666 100644\n--- a/src/plone/restapi/services/copymove/copymove.py\n+++ b/src/plone/restapi/services/copymove/copymove.py\n@@ -29,7 +29,7 @@ def get_object(self, key):\n if isinstance(key, six.string_types):\n if key.startswith(self.portal_url):\n # Resolve by URL\n- key = key[len(self.portal_url) + 1 :]\n+ key = key[len(self.portal_url) + 1:]\n if six.PY2:\n key = key.encode("utf8")\n return self.portal.restrictedTraverse(key, None)\ndiff --git a/src/plone/restapi/services/multilingual/pam.py b/src/plone/restapi/services/multilingual/pam.py\nindex 37fa6735..d7773106 100644\n--- a/src/plone/restapi/services/multilingual/pam.py\n+++ b/src/plone/restapi/services/multilingual/pam.py\n@@ -97,7 +97,7 @@ def _traverse(self, url):\n portal = purl.getPortalObject()\n portal_url = portal.absolute_url()\n if url.startswith(portal_url):\n- content_path = url[len(portal_url) + 1 :]\n+ content_path = url[len(portal_url) + 1:]\n content_path = content_path.split("/")\n content_item = portal.restrictedTraverse(content_path)\n return content_item\ndiff --git a/src/plone/restapi/services/navigation/get.py b/src/plone/restapi/services/navigation/get.py\nindex e3fbedda..c34815cd 100644\n--- a/src/plone/restapi/services/navigation/get.py\n+++ b/src/plone/restapi/services/navigation/get.py\n@@ -51,7 +51,7 @@ def getRootPath(self, topLevel=1):\n contextPath = "/".join(self.context.getPhysicalPath())\n if not contextPath.startswith(rootPath):\n return None\n- contextSubPathElements = contextPath[len(rootPath) + 1 :]\n+ contextSubPathElements = contextPath[len(rootPath) + 1:]\n if contextSubPathElements:\n contextSubPathElements = contextSubPathElements.split("/")\n if len(contextSubPathElements) < topLevel:\ndiff --git a/src/plone/restapi/services/workflow/transition.py b/src/plone/restapi/services/workflow/transition.py\nindex 307de026..6f17989f 100644\n--- a/src/plone/restapi/services/workflow/transition.py\n+++ b/src/plone/restapi/services/workflow/transition.py\n@@ -105,7 +105,7 @@ def recurse_transition(\n )\n deserializer(data=publication_dates)\n \n- if obj.EffectiveDate() == \'None\':\n+ if obj.EffectiveDate() == "None":\n obj.setEffectiveDate(DateTime())\n obj.reindexObject()\n \ndiff --git a/src/plone/restapi/setuphandlers.py b/src/plone/restapi/setuphandlers.py\nindex a948b3d1..aaaf2165 100644\n--- a/src/plone/restapi/setuphandlers.py\n+++ b/src/plone/restapi/setuphandlers.py\n@@ -4,7 +4,9 @@\n from plone.restapi.pas.plugin import JWTAuthenticationPlugin\n from Products.CMFCore.utils import getToolByName\n from Products.CMFPlone.interfaces import INonInstallable\n-from Products.PluggableAuthService.interfaces.authservice import IPluggableAuthService # noqa: E501\n+from Products.PluggableAuthService.interfaces.authservice import (\n+ IPluggableAuthService,\n+) # noqa: E501\n from zope.interface import implementer\n \n \ndiff --git a/src/plone/restapi/tests/test_services_users.py b/src/plone/restapi/tests/test_services_users.py\nindex cba88a5f..8e8fa051 100644\n--- a/src/plone/restapi/tests/test_services_users.py\n+++ b/src/plone/restapi/tests/test_services_users.py\n@@ -22,7 +22,6 @@\n from plone.app.controlpanel.security import ISecuritySchema\n \n \n-\n class TestUsersEndpoint(unittest.TestCase):\n \n layer = PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\ndiff --git a/src/plone/restapi/tests/test_time_freezing.py b/src/plone/restapi/tests/test_time_freezing.py\nindex de46fc15..0e28dd33 100644\n--- a/src/plone/restapi/tests/test_time_freezing.py\n+++ b/src/plone/restapi/tests/test_time_freezing.py\n@@ -7,14 +7,13 @@\n \n \n class TestTimeFreezing(unittest.TestCase):\n-\n def test_freezegun_provides_original_time_functions(self):\n """This test guards against future API changes in freezegun.\n """\n # These module globals in freezegun.api provide access to the\n # original time functions.\n- self.assertTrue(hasattr(freezegun.api, \'real_time\'))\n- self.assertTrue(hasattr(freezegun.api, \'real_gmtime\'))\n+ self.assertTrue(hasattr(freezegun.api, "real_time"))\n+ self.assertTrue(hasattr(freezegun.api, "real_gmtime"))\n \n # Before freezing time, they should be references to the\n # real time functions\ndiff --git a/src/plone/restapi/tests/test_types.py b/src/plone/restapi/tests/test_types.py\nindex eed2f5ba..c790cc32 100644\n--- a/src/plone/restapi/tests/test_types.py\n+++ b/src/plone/restapi/tests/test_types.py\n@@ -203,20 +203,20 @@ def dummy_source_vocab(self, context):\n )\n \n def test_context_aware_default_factory(self):\n- folder = self.portal[self.portal.invokeFactory(\n- "Folder", id="folder", title="My Folder")]\n+ folder = self.portal[\n+ self.portal.invokeFactory("Folder", id="folder", title="My Folder")\n+ ]\n \n @provider(IContextAwareDefaultFactory)\n def uppercased_title_default(context):\n return context.title.upper()\n \n field = schema.TextLine(\n- title=u"My field", description=u"My great field",\n- defaultFactory=uppercased_title_default\n- )\n- adapter = getMultiAdapter(\n- (field, folder, self.request), IJsonSchemaProvider\n+ title=u"My field",\n+ description=u"My great field",\n+ defaultFactory=uppercased_title_default,\n )\n+ adapter = getMultiAdapter((field, folder, self.request), IJsonSchemaProvider)\n \n self.assertEqual(\n {\ndiff --git a/src/plone/restapi/tests/test_workflow.py b/src/plone/restapi/tests/test_workflow.py\nindex e29d8735..dfe790a3 100644\n--- a/src/plone/restapi/tests/test_workflow.py\n+++ b/src/plone/restapi/tests/test_workflow.py\n@@ -131,7 +131,7 @@ def test_transition_action_succeeds_changes_effective(self):\n doc1 = self.portal.doc1\n self.assertEqual(doc1.effective_date, None)\n now = DateTime()\n- service = self.traverse(\'/plone/doc1/@workflow/publish\')\n+ service = self.traverse("/plone/doc1/@workflow/publish")\n service.reply()\n self.assertTrue(isinstance(doc1.effective_date, DateTime))\n self.assertTrue(doc1.effective_date >= now)\n' - -Repository: plone.restapi - - -Branch: refs/heads/master -Date: 2019-06-22T09:13:48+02:00 -Author: Timo Stollenwerk (tisto) -Commit: https://github.com/plone/plone.restapi/commit/d57b8ef7af757d5812b2c53a061861fe3ffc0dde - -Merge pull request #762 from plone/isort - -Fix flake8 plugins +Add support for Python 3.8 Files changed: -M Makefile -M base.cfg -M src/plone/restapi/__init__.py -M src/plone/restapi/batching.py -M src/plone/restapi/controlpanels.py -M src/plone/restapi/deserializer/atcontent.py -M src/plone/restapi/deserializer/atfields.py -M src/plone/restapi/deserializer/controlpanels.py -M src/plone/restapi/deserializer/dxcontent.py -M src/plone/restapi/deserializer/local_roles.py -M src/plone/restapi/deserializer/relationfield.py -M src/plone/restapi/deserializer/site.py -M src/plone/restapi/imaging.py -M src/plone/restapi/pas/plugin.py -M src/plone/restapi/serializer/atcontent.py -M src/plone/restapi/serializer/atfields.py -M src/plone/restapi/serializer/controlpanels.py -M src/plone/restapi/serializer/converters.py -M src/plone/restapi/serializer/expansion.py -M src/plone/restapi/serializer/registry.py -M src/plone/restapi/serializer/site.py -M src/plone/restapi/serializer/tile.py -M src/plone/restapi/serializer/user.py -M src/plone/restapi/services/__init__.py -M src/plone/restapi/services/actions/get.py -M src/plone/restapi/services/auth/login.py -M src/plone/restapi/services/auth/logout.py -M src/plone/restapi/services/breadcrumbs/get.py -M src/plone/restapi/services/content/sharing.py -M src/plone/restapi/services/content/tus.py -M src/plone/restapi/services/content/update.py -M src/plone/restapi/services/controlpanels/patch.py -M src/plone/restapi/services/copymove/copymove.py -M src/plone/restapi/services/discussion/conversation.py -M src/plone/restapi/services/email_send/post.py -M src/plone/restapi/services/groups/add.py -M src/plone/restapi/services/groups/get.py -M src/plone/restapi/services/groups/update.py -M src/plone/restapi/services/history/get.py -M src/plone/restapi/services/history/patch.py -M src/plone/restapi/services/multilingual/pam.py -M src/plone/restapi/services/navigation/get.py -M src/plone/restapi/services/registry/get.py -M src/plone/restapi/services/tiles/get.py -M src/plone/restapi/services/users/add.py -M src/plone/restapi/services/users/get.py -M src/plone/restapi/services/vocabularies/get.py -M src/plone/restapi/services/workflow/info.py -M src/plone/restapi/services/workflow/transition.py -M src/plone/restapi/tests/attypes.py -M src/plone/restapi/tests/dxtypes.py -M src/plone/restapi/tests/mixin_ordering.py -M src/plone/restapi/tests/performance.py -M src/plone/restapi/tests/test_atcollection.py -M src/plone/restapi/tests/test_atcontent_deserializer.py -M src/plone/restapi/tests/test_atcontent_serializer.py -M src/plone/restapi/tests/test_atfield_deserializer.py -M src/plone/restapi/tests/test_atfield_serializer.py -M src/plone/restapi/tests/test_auth.py -M src/plone/restapi/tests/test_batching.py -M src/plone/restapi/tests/test_boolean_value.py -M src/plone/restapi/tests/test_comments.py -M src/plone/restapi/tests/test_content_delete.py -M src/plone/restapi/tests/test_content_get.py -M src/plone/restapi/tests/test_content_local_roles.py -M src/plone/restapi/tests/test_copymove.py -M src/plone/restapi/tests/test_documentation.py -M src/plone/restapi/tests/test_dxcontent_deserializer.py -M src/plone/restapi/tests/test_dxcontent_serializer.py -M src/plone/restapi/tests/test_dxfield_deserializer.py -M src/plone/restapi/tests/test_dxfield_serializer.py -M src/plone/restapi/tests/test_error_handling.py -M src/plone/restapi/tests/test_expansion.py -M src/plone/restapi/tests/test_functional_auth.py -M src/plone/restapi/tests/test_locking.py -M src/plone/restapi/tests/test_pas.py -M src/plone/restapi/tests/test_permissions.py -M src/plone/restapi/tests/test_profile_tiles.py -M src/plone/restapi/tests/test_query_parsers.py -M src/plone/restapi/tests/test_registry.py -M src/plone/restapi/tests/test_registry_serializer.py -M src/plone/restapi/tests/test_serializer_converters.py -M src/plone/restapi/tests/test_services.py -M src/plone/restapi/tests/test_services_actions.py -M src/plone/restapi/tests/test_services_comments.py -M src/plone/restapi/tests/test_services_content.py -M src/plone/restapi/tests/test_services_controlpanels.py -M src/plone/restapi/tests/test_services_email_notification.py -M src/plone/restapi/tests/test_services_email_send.py -M src/plone/restapi/tests/test_services_history.py -M src/plone/restapi/tests/test_services_types.py -M src/plone/restapi/tests/test_services_users.py -M src/plone/restapi/tests/test_services_vocabularies.py -M src/plone/restapi/tests/test_setup.py -M src/plone/restapi/tests/test_site_serializer.py -M src/plone/restapi/tests/test_time_freezing.py -M src/plone/restapi/tests/test_tus.py -M src/plone/restapi/tests/test_types.py -M src/plone/restapi/tests/test_workflow.py -M src/plone/restapi/types/adapters.py -M src/plone/restapi/types/utils.py -M src/plone/restapi/types/z3crelationadapter.py -D .flake8 +A news/20.feature +M Products/CMFFormController/Actions/BaseFormAction.py -b'diff --git a/.flake8 b/.flake8\ndeleted file mode 100644\nindex d163169f..00000000\n--- a/.flake8\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-# https://github.com/ambv/black/blob/master/.flake8\n-[flake8]\n-ignore = E203, E266, E501, W503\n-max-line-length = 88\n-max-complexity = 25\n-select = B,C,E,F,W,T4,B9\ndiff --git a/Makefile b/Makefile\nindex 60eba0a9..cb1d1abf 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -66,6 +66,7 @@ build-py3: ## Build Plone 5.2 with Python 3\n \tvirtualenv --python=python3 .\n \tbin/pip install --upgrade pip\n \tbin/pip install -r requirements.txt\n+\tbin/pip install black\n \tbin/buildout -c plone-5.2.x.cfg\n \n bin/python bin/pip:\ndiff --git a/base.cfg b/base.cfg\nindex 60addc79..e9bf2a8a 100644\n--- a/base.cfg\n+++ b/base.cfg\n@@ -100,10 +100,14 @@ recipe = plone.recipe.codeanalysis\n directory = ${buildout:directory}/src\n flake8-exclude=bootstrap.py,bootstrap-buildout.py,docs,bin,*.egg,setup.py,overrides\n flake8-max-complexity = 25\n+# flake8-ignore = E203, E266, E501, W503\n+flake8-max-line-length = 200\n+# flake8-select = B,C,E,F,W,T4,B9\n flake8-extensions =\n flake8-coding\n flake8-debugger\n flake8-print\n+# flake8-isort\n # additional pep8/flake8 rules, see docs for details\n # https://pep8.readthedocs.io/en/1.4.6/intro.html#error-codes\n # - E123: closing bracket does not match indentation of opening bracket\xe2\x80\x99s line\ndiff --git a/src/plone/restapi/__init__.py b/src/plone/restapi/__init__.py\nindex a6dbf5d6..b3a1526d 100644\n--- a/src/plone/restapi/__init__.py\n+++ b/src/plone/restapi/__init__.py\n@@ -1,14 +1,15 @@\n # -*- coding: utf-8 -*-\n from AccessControl import allow_module\n from AccessControl.Permissions import add_user_folders\n+from plone.restapi.pas import plugin\n from Products.PluggableAuthService.PluggableAuthService import (\n registerMultiPlugin,\n-) # noqa\n-from plone.restapi.pas import plugin\n+)\n from zope.i18nmessageid import MessageFactory\n \n import pkg_resources\n \n+\n _ = MessageFactory("plone.restapi")\n PROJECT_NAME = "plone.restapi"\n \ndiff --git a/src/plone/restapi/batching.py b/src/plone/restapi/batching.py\nindex c25479d5..9930c21b 100644\n--- a/src/plone/restapi/batching.py\n+++ b/src/plone/restapi/batching.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n from plone.batching.batch import Batch\n-from six.moves.urllib.parse import urlencode\n from six.moves.urllib.parse import parse_qsl\n+from six.moves.urllib.parse import urlencode\n \n \n DEFAULT_BATCH_SIZE = 25\ndiff --git a/src/plone/restapi/controlpanels.py b/src/plone/restapi/controlpanels.py\nindex 9b954f6d..66237fa7 100644\n--- a/src/plone/restapi/controlpanels.py\n+++ b/src/plone/restapi/controlpanels.py\n@@ -1,19 +1,20 @@\n # -*- coding: utf-8 -*-\n-from zope.interface import implementer, Interface, Attribute\n-from zope.component import adapter\n from Products.CMFCore.utils import getToolByName\n-\n from Products.CMFPlone.interfaces.controlpanel import IDateAndTimeSchema\n from Products.CMFPlone.interfaces.controlpanel import IEditingSchema\n+from Products.CMFPlone.interfaces.controlpanel import IImagingSchema\n from Products.CMFPlone.interfaces.controlpanel import ILanguageSchema\n from Products.CMFPlone.interfaces.controlpanel import IMailSchema\n+from Products.CMFPlone.interfaces.controlpanel import IMarkupSchema\n from Products.CMFPlone.interfaces.controlpanel import INavigationSchema\n-from Products.CMFPlone.interfaces.controlpanel import ISiteSchema\n from Products.CMFPlone.interfaces.controlpanel import ISearchSchema\n-from Products.CMFPlone.interfaces.controlpanel import ISocialMediaSchema\n-from Products.CMFPlone.interfaces.controlpanel import IImagingSchema\n-from Products.CMFPlone.interfaces.controlpanel import IMarkupSchema\n from Products.CMFPlone.interfaces.controlpanel import ISecuritySchema\n+from Products.CMFPlone.interfaces.controlpanel import ISiteSchema\n+from Products.CMFPlone.interfaces.controlpanel import ISocialMediaSchema\n+from zope.component import adapter\n+from zope.interface import Attribute\n+from zope.interface import implementer\n+from zope.interface import Interface\n \n \n class IControlpanel(Interface):\ndiff --git a/src/plone/restapi/deserializer/atcontent.py b/src/plone/restapi/deserializer/atcontent.py\nindex c4a3afa0..63bc7d8c 100644\n--- a/src/plone/restapi/deserializer/atcontent.py\n+++ b/src/plone/restapi/deserializer/atcontent.py\n@@ -1,21 +1,20 @@\n # -*- coding: utf-8 -*-\n+from .mixins import OrderingMixin\n+from plone.restapi.deserializer import json_body\n+from plone.restapi.interfaces import IDeserializeFromJson\n+from plone.restapi.interfaces import IFieldDeserializer\n from Products.Archetypes.event import ObjectEditedEvent\n from Products.Archetypes.event import ObjectInitializedEvent\n from Products.Archetypes.interfaces import IBaseObject\n from Products.Archetypes.interfaces import IObjectPostValidation\n from Products.Archetypes.interfaces import IObjectPreValidation\n-from plone.restapi.deserializer import json_body\n-from plone.restapi.interfaces import IDeserializeFromJson\n-from plone.restapi.interfaces import IFieldDeserializer\n from zExceptions import BadRequest\n from zope.component import adapter\n from zope.component import queryMultiAdapter\n from zope.component import subscribers\n from zope.event import notify\n-from zope.interface import Interface\n from zope.interface import implementer\n-\n-from .mixins import OrderingMixin\n+from zope.interface import Interface\n \n \n @implementer(IDeserializeFromJson)\ndiff --git a/src/plone/restapi/deserializer/atfields.py b/src/plone/restapi/deserializer/atfields.py\nindex 5cb4be16..4e322be0 100644\n--- a/src/plone/restapi/deserializer/atfields.py\n+++ b/src/plone/restapi/deserializer/atfields.py\n@@ -1,11 +1,11 @@\n # -*- coding: utf-8 -*-\n+from plone.app.blob.interfaces import IBlobField\n+from plone.restapi.interfaces import IFieldDeserializer\n+from plone.restapi.services.content.tus import TUSUpload\n from Products.Archetypes.interfaces import IBaseObject\n from Products.Archetypes.interfaces.field import IField\n from Products.Archetypes.interfaces.field import IFileField\n from Products.Archetypes.interfaces.field import IReferenceField\n-from plone.app.blob.interfaces import IBlobField\n-from plone.restapi.interfaces import IFieldDeserializer\n-from plone.restapi.services.content.tus import TUSUpload\n from zope.component import adapter\n from zope.component import getMultiAdapter\n from zope.interface import implementer\n@@ -70,7 +70,7 @@ def __call__(self, value):\n for i, v in enumerate(value):\n # Resolve references given by URL\n if v.startswith(portal_url):\n- path = v[len(portal_url) + 1 :].encode("utf8")\n+ path = v[len(portal_url) + 1:].encode("utf8")\n value[i] = portal.unrestrictedTraverse(path, None)\n \n return value, {}\ndiff --git a/src/plone/restapi/deserializer/controlpanels.py b/src/plone/restapi/deserializer/controlpanels.py\nindex 5aebcf2c..9a8b01eb 100644\n--- a/src/plone/restapi/deserializer/controlpanels.py\n+++ b/src/plone/restapi/deserializer/controlpanels.py\n@@ -1,18 +1,18 @@\n # -*- coding: utf-8 -*-\n+from plone.dexterity.interfaces import IDexterityContent\n from plone.registry.interfaces import IRegistry\n from plone.restapi.controlpanels import IControlpanel\n from plone.restapi.deserializer import json_body\n from plone.restapi.interfaces import IDeserializeFromJson\n+from plone.restapi.interfaces import IFieldDeserializer\n+from z3c.form.interfaces import IManagerValidator\n from zExceptions import BadRequest\n from zope.component import adapter\n from zope.component import getUtility\n+from zope.component import queryMultiAdapter\n from zope.interface import implementer\n from zope.schema import getFields\n from zope.schema.interfaces import ValidationError\n-from plone.dexterity.interfaces import IDexterityContent\n-from zope.component import queryMultiAdapter\n-from plone.restapi.interfaces import IFieldDeserializer\n-from z3c.form.interfaces import IManagerValidator\n \n \n @implementer(IDexterityContent)\ndiff --git a/src/plone/restapi/deserializer/dxcontent.py b/src/plone/restapi/deserializer/dxcontent.py\nindex 33876ba2..536ebb50 100644\n--- a/src/plone/restapi/deserializer/dxcontent.py\n+++ b/src/plone/restapi/deserializer/dxcontent.py\n@@ -1,4 +1,5 @@\n # -*- coding: utf-8 -*-\n+from .mixins import OrderingMixin\n from AccessControl import getSecurityManager\n from plone.autoform.interfaces import WRITE_PERMISSIONS_KEY\n from plone.dexterity.interfaces import IDexterityContent\n@@ -14,16 +15,14 @@\n from zope.component import queryMultiAdapter\n from zope.component import queryUtility\n from zope.event import notify\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n from zope.lifecycleevent import Attributes\n from zope.lifecycleevent import ObjectModifiedEvent\n from zope.schema import getFields\n from zope.schema.interfaces import ValidationError\n from zope.security.interfaces import IPermission\n \n-from .mixins import OrderingMixin\n-\n \n @implementer(IDeserializeFromJson)\n @adapter(IDexterityContent, Interface)\ndiff --git a/src/plone/restapi/deserializer/local_roles.py b/src/plone/restapi/deserializer/local_roles.py\nindex 8a24c2b0..375eb062 100644\n--- a/src/plone/restapi/deserializer/local_roles.py\n+++ b/src/plone/restapi/deserializer/local_roles.py\n@@ -9,6 +9,7 @@\n from zope.interface import implementer\n from zope.interface import Interface\n \n+\n try:\n from plone.app.workflow.events import LocalrolesModifiedEvent\n \ndiff --git a/src/plone/restapi/deserializer/relationfield.py b/src/plone/restapi/deserializer/relationfield.py\nindex 3d07b8a1..a313f822 100644\n--- a/src/plone/restapi/deserializer/relationfield.py\n+++ b/src/plone/restapi/deserializer/relationfield.py\n@@ -1,8 +1,8 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n from plone.dexterity.interfaces import IDexterityContent\n from plone.restapi.deserializer.dxfields import DefaultFieldDeserializer\n from plone.restapi.interfaces import IFieldDeserializer\n+from Products.CMFCore.utils import getToolByName\n from z3c.relationfield.interfaces import IRelationChoice\n from zope.component import adapter\n from zope.component import getMultiAdapter\n@@ -10,6 +10,7 @@\n from zope.interface import implementer\n from zope.intid.interfaces import IIntIds\n from zope.publisher.interfaces.browser import IBrowserRequest\n+\n import six\n \n \n@@ -38,7 +39,7 @@ def __call__(self, value):\n portal_url = portal.absolute_url()\n if value.startswith(portal_url):\n # Resolve by URL\n- obj = portal.restrictedTraverse(value[len(portal_url) + 1 :], None)\n+ obj = portal.restrictedTraverse(value[len(portal_url) + 1:], None)\n resolved_by = "URL"\n elif value.startswith("/"):\n # Resolve by path\ndiff --git a/src/plone/restapi/deserializer/site.py b/src/plone/restapi/deserializer/site.py\nindex c66d9069..68615612 100644\n--- a/src/plone/restapi/deserializer/site.py\n+++ b/src/plone/restapi/deserializer/site.py\n@@ -1,11 +1,10 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFPlone.interfaces import IPloneSiteRoot\n from plone.restapi.deserializer import json_body\n+from plone.restapi.deserializer.mixins import OrderingMixin\n from plone.restapi.interfaces import IDeserializeFromJson\n+from Products.CMFPlone.interfaces import IPloneSiteRoot\n from zope.component import adapter\n from zope.interface import implementer\n-\n-from plone.restapi.deserializer.mixins import OrderingMixin\n from zope.publisher.interfaces import IRequest\n \n import json\ndiff --git a/src/plone/restapi/imaging.py b/src/plone/restapi/imaging.py\nindex 827614d5..5a94ef1c 100644\n--- a/src/plone/restapi/imaging.py\n+++ b/src/plone/restapi/imaging.py\n@@ -1,10 +1,11 @@\n # -*- coding: utf-8 -*-\n from __future__ import division\n from Products.CMFCore.interfaces import IPropertiesTool\n+from six.moves import map\n from zope.component import getMultiAdapter\n from zope.component import getUtility\n from zope.globalrequest import getRequest\n-from six.moves import map\n+\n \n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\ndiff --git a/src/plone/restapi/pas/plugin.py b/src/plone/restapi/pas/plugin.py\nindex 7b457345..58a34564 100644\n--- a/src/plone/restapi/pas/plugin.py\n+++ b/src/plone/restapi/pas/plugin.py\n@@ -1,20 +1,21 @@\n # -*- coding: utf-8 -*-\n-from AccessControl.SecurityInfo import ClassSecurityInfo\n from AccessControl.requestmethod import postonly\n+from AccessControl.SecurityInfo import ClassSecurityInfo\n from BTrees.OIBTree import OIBTree\n from BTrees.OOBTree import OOBTree\n+from datetime import datetime\n+from datetime import timedelta\n+from plone.keyring.interfaces import IKeyManager\n+from plone.keyring.keyring import GenerateSecret\n from Products.CMFCore.permissions import ManagePortal\n from Products.PageTemplates.PageTemplateFile import PageTemplateFile\n from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin\n from Products.PluggableAuthService.interfaces.plugins import IChallengePlugin\n from Products.PluggableAuthService.interfaces.plugins import IExtractionPlugin\n from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin\n-from datetime import datetime\n-from datetime import timedelta\n-from plone.keyring.interfaces import IKeyManager\n-from plone.keyring.keyring import GenerateSecret\n from zope.component import getUtility\n from zope.interface import implementer\n+\n import jwt\n import six\n import time\ndiff --git a/src/plone/restapi/serializer/atcontent.py b/src/plone/restapi/serializer/atcontent.py\nindex cb659f3f..36d22391 100644\n--- a/src/plone/restapi/serializer/atcontent.py\n+++ b/src/plone/restapi/serializer/atcontent.py\n@@ -1,20 +1,20 @@\n # -*- coding: utf-8 -*-\n from Acquisition import aq_inner\n from Acquisition import aq_parent\n-from Products.Archetypes.interfaces import IBaseFolder\n-from Products.Archetypes.interfaces import IBaseObject\n-from Products.CMFCore.utils import getToolByName\n from plone.restapi.batching import HypermediaBatch\n from plone.restapi.deserializer import boolean_value\n from plone.restapi.interfaces import IFieldSerializer\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.interfaces import ISerializeToJsonSummary\n from plone.restapi.serializer.expansion import expandable_elements\n+from Products.Archetypes.interfaces import IBaseFolder\n+from Products.Archetypes.interfaces import IBaseObject\n+from Products.CMFCore.utils import getToolByName\n from zope.component import adapter\n from zope.component import getMultiAdapter\n from zope.component import queryMultiAdapter\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n \n \n @implementer(ISerializeToJson)\ndiff --git a/src/plone/restapi/serializer/atfields.py b/src/plone/restapi/serializer/atfields.py\nindex 9c12d1f9..4a12f013 100644\n--- a/src/plone/restapi/serializer/atfields.py\n+++ b/src/plone/restapi/serializer/atfields.py\n@@ -1,6 +1,10 @@\n # -*- coding: utf-8 -*-\n-from six.moves import map\n-\n+from plone.app.blob.interfaces import IBlobField\n+from plone.app.blob.interfaces import IBlobImageField\n+from plone.restapi.imaging import get_original_image_url\n+from plone.restapi.imaging import get_scales\n+from plone.restapi.interfaces import IFieldSerializer\n+from plone.restapi.serializer.converters import json_compatible\n from Products.Archetypes.interfaces import IBaseObject\n from Products.Archetypes.interfaces.field import IField\n from Products.Archetypes.interfaces.field import IFileField\n@@ -8,15 +12,11 @@\n from Products.Archetypes.interfaces.field import IReferenceField\n from Products.Archetypes.interfaces.field import ITextField\n from Products.CMFCore.utils import getToolByName\n-from plone.app.blob.interfaces import IBlobField\n-from plone.app.blob.interfaces import IBlobImageField\n-from plone.restapi.imaging import get_scales\n-from plone.restapi.imaging import get_original_image_url\n-from plone.restapi.interfaces import IFieldSerializer\n-from plone.restapi.serializer.converters import json_compatible\n+from six.moves import map\n from zope.component import adapter\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n+\n \n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\ndiff --git a/src/plone/restapi/serializer/controlpanels.py b/src/plone/restapi/serializer/controlpanels.py\nindex 5a95eb3f..cd5c0a52 100644\n--- a/src/plone/restapi/serializer/controlpanels.py\n+++ b/src/plone/restapi/serializer/controlpanels.py\n@@ -7,13 +7,16 @@\n from plone.restapi.interfaces import ISerializeToJsonSummary\n from plone.restapi.serializer.converters import json_compatible\n from plone.restapi.types import utils\n-from zope.component import adapter, queryMultiAdapter, getUtility\n+from zope.component import adapter\n+from zope.component import getUtility\n+from zope.component import queryMultiAdapter\n from zope.interface import alsoProvides\n from zope.interface import implementer\n from zope.interface import noLongerProvides\n \n import zope.schema\n \n+\n SERVICE_ID = "@controlpanels"\n \n \ndiff --git a/src/plone/restapi/serializer/converters.py b/src/plone/restapi/serializer/converters.py\nindex f44af42b..cf1e18ec 100644\n--- a/src/plone/restapi/serializer/converters.py\n+++ b/src/plone/restapi/serializer/converters.py\n@@ -1,9 +1,9 @@\n # -*- coding: utf-8 -*-\n-from DateTime import DateTime\n from datetime import date\n from datetime import datetime\n from datetime import time\n from datetime import timedelta\n+from DateTime import DateTime\n from persistent.list import PersistentList\n from persistent.mapping import PersistentMapping\n from plone.app.textfield.interfaces import IRichTextValue\n@@ -11,6 +11,8 @@\n from plone.restapi.interfaces import IContextawareJsonCompatible\n from plone.restapi.interfaces import IJsonCompatible\n from Products.CMFPlone.utils import safe_unicode\n+from six.moves import map\n+from six.moves import zip\n from zope.component import adapter\n from zope.component import queryMultiAdapter\n from zope.globalrequest import getRequest\n@@ -22,8 +24,7 @@\n import Missing\n import pytz\n import six\n-from six.moves import map\n-from six.moves import zip\n+\n \n # import re\n \ndiff --git a/src/plone/restapi/serializer/expansion.py b/src/plone/restapi/serializer/expansion.py\nindex 901b1e92..552c233d 100644\n--- a/src/plone/restapi/serializer/expansion.py\n+++ b/src/plone/restapi/serializer/expansion.py\n@@ -1,6 +1,7 @@\n # -*- coding: utf-8 -*-\n from plone.restapi.interfaces import IExpandableElement\n from zope.component import getAdapters\n+\n import six\n \n \ndiff --git a/src/plone/restapi/serializer/registry.py b/src/plone/restapi/serializer/registry.py\nindex a9014a74..8d2f1c6f 100644\n--- a/src/plone/restapi/serializer/registry.py\n+++ b/src/plone/restapi/serializer/registry.py\n@@ -1,9 +1,10 @@\n # -*- coding: utf-8 -*-\n+from plone.registry.interfaces import IRegistry\n from plone.restapi.batching import HypermediaBatch\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.types.interfaces import IJsonSchemaProvider\n-from plone.registry.interfaces import IRegistry\n-from zope.component import adapter, getMultiAdapter\n+from zope.component import adapter\n+from zope.component import getMultiAdapter\n from zope.interface import implementer\n from zope.publisher.interfaces import IRequest\n \ndiff --git a/src/plone/restapi/serializer/site.py b/src/plone/restapi/serializer/site.py\nindex 0aeb3f71..243c7213 100644\n--- a/src/plone/restapi/serializer/site.py\n+++ b/src/plone/restapi/serializer/site.py\n@@ -1,14 +1,14 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n-from Products.CMFPlone.interfaces import IPloneSiteRoot\n from plone.restapi.batching import HypermediaBatch\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.interfaces import ISerializeToJsonSummary\n from plone.restapi.serializer.expansion import expandable_elements\n+from Products.CMFCore.utils import getToolByName\n+from Products.CMFPlone.interfaces import IPloneSiteRoot\n from zope.component import adapter\n from zope.component import getMultiAdapter\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n \n import json\n \ndiff --git a/src/plone/restapi/serializer/tile.py b/src/plone/restapi/serializer/tile.py\nindex df93e6f7..567a9996 100644\n--- a/src/plone/restapi/serializer/tile.py\n+++ b/src/plone/restapi/serializer/tile.py\n@@ -2,11 +2,12 @@\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.interfaces import ISerializeToJsonSummary\n from plone.restapi.types import utils\n-from zope.interface import implementer\n-from zope.interface import Interface\n from plone.tiles.interfaces import ITileType\n from zope.component import adapter\n from zope.component.hooks import getSite\n+from zope.interface import implementer\n+from zope.interface import Interface\n+\n \n SERVICE_ID = "@tiles"\n \ndiff --git a/src/plone/restapi/serializer/user.py b/src/plone/restapi/serializer/user.py\nindex c4b06594..481c829b 100644\n--- a/src/plone/restapi/serializer/user.py\n+++ b/src/plone/restapi/serializer/user.py\n@@ -11,6 +11,7 @@\n from zope.publisher.interfaces import IRequest\n from zope.schema import getFieldNames\n \n+\n try:\n # Plone 5\n from plone.app.users.browser.userdatapanel import getUserDataSchema\ndiff --git a/src/plone/restapi/services/__init__.py b/src/plone/restapi/services/__init__.py\nindex d2986d9d..5f8e72a7 100644\n--- a/src/plone/restapi/services/__init__.py\n+++ b/src/plone/restapi/services/__init__.py\n@@ -6,6 +6,7 @@\n \n import json\n \n+\n _no_content_marker = object()\n \n \ndiff --git a/src/plone/restapi/services/actions/get.py b/src/plone/restapi/services/actions/get.py\nindex cb5f8111..e37bb054 100644\n--- a/src/plone/restapi/services/actions/get.py\n+++ b/src/plone/restapi/services/actions/get.py\n@@ -1,13 +1,13 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.interfaces import IActionCategory\n-from Products.CMFCore.utils import getToolByName\n from plone.restapi.interfaces import IExpandableElement\n from plone.restapi.services import Service\n+from Products.CMFCore.interfaces import IActionCategory\n+from Products.CMFCore.utils import getToolByName\n from zope.component import adapter\n from zope.component import getMultiAdapter\n from zope.i18n import translate\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n \n \n @implementer(IExpandableElement)\ndiff --git a/src/plone/restapi/services/auth/login.py b/src/plone/restapi/services/auth/login.py\nindex aa618dd2..3937ce65 100644\n--- a/src/plone/restapi/services/auth/login.py\n+++ b/src/plone/restapi/services/auth/login.py\n@@ -6,7 +6,7 @@\n from Products.CMFCore.utils import getToolByName\n from Products.PluggableAuthService.interfaces.plugins import (\n IAuthenticationPlugin,\n-) # noqa\n+)\n from zope.interface import alsoProvides\n \n import plone.protect.interfaces\ndiff --git a/src/plone/restapi/services/auth/logout.py b/src/plone/restapi/services/auth/logout.py\nindex bbca18c3..f24ab14b 100644\n--- a/src/plone/restapi/services/auth/logout.py\n+++ b/src/plone/restapi/services/auth/logout.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n+from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin\n-from plone.restapi.services import Service\n \n \n class Logout(Service):\ndiff --git a/src/plone/restapi/services/breadcrumbs/get.py b/src/plone/restapi/services/breadcrumbs/get.py\nindex fff5bc6a..ab11ca3e 100644\n--- a/src/plone/restapi/services/breadcrumbs/get.py\n+++ b/src/plone/restapi/services/breadcrumbs/get.py\n@@ -3,8 +3,8 @@\n from plone.restapi.services import Service\n from zope.component import adapter\n from zope.component import getMultiAdapter\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n \n \n @implementer(IExpandableElement)\ndiff --git a/src/plone/restapi/services/content/sharing.py b/src/plone/restapi/services/content/sharing.py\nindex 791add05..459c2035 100644\n--- a/src/plone/restapi/services/content/sharing.py\n+++ b/src/plone/restapi/services/content/sharing.py\n@@ -3,8 +3,8 @@\n from plone.restapi.interfaces import IDeserializeFromJson\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.services import Service\n-from zope.interface import alsoProvides\n from zope.component import queryMultiAdapter\n+from zope.interface import alsoProvides\n from zope.security import checkPermission\n \n import plone.protect.interfaces\ndiff --git a/src/plone/restapi/services/content/tus.py b/src/plone/restapi/services/content/tus.py\nindex 4a8057e6..c26876e9 100644\n--- a/src/plone/restapi/services/content/tus.py\n+++ b/src/plone/restapi/services/content/tus.py\n@@ -1,10 +1,7 @@\n # -*- coding: utf-8 -*-\n+from AccessControl.SecurityManagement import getSecurityManager\n from Acquisition import aq_base\n from Acquisition.interfaces import IAcquirer\n-from AccessControl.SecurityManagement import getSecurityManager\n-from Products.CMFCore.utils import getToolByName\n-from Products.CMFPlone.utils import base_hasattr\n-from Products.CMFPlone.utils import safe_hasattr\n from base64 import b64decode\n from email.utils import formatdate\n from fnmatch import fnmatch\n@@ -12,22 +9,26 @@\n from plone.restapi.exceptions import DeserializationError\n from plone.restapi.interfaces import IDeserializeFromJson\n from plone.restapi.services import Service\n-from plone.restapi.services.content.utils import create\n from plone.restapi.services.content.utils import add\n+from plone.restapi.services.content.utils import create\n from plone.rfc822.interfaces import IPrimaryFieldInfo\n+from Products.CMFCore.utils import getToolByName\n+from Products.CMFPlone.utils import base_hasattr\n+from Products.CMFPlone.utils import safe_hasattr\n from uuid import uuid4\n from zExceptions import Unauthorized\n from zope.component import queryMultiAdapter\n+from zope.event import notify\n from zope.interface import implementer\n+from zope.lifecycleevent import ObjectCreatedEvent\n from zope.publisher.interfaces import IPublishTraverse\n from zope.publisher.interfaces import NotFound\n-from zope.lifecycleevent import ObjectCreatedEvent\n-from zope.event import notify\n \n import json\n import os\n import time\n \n+\n TUS_OPTIONS_RESPONSE_HEADERS = {\n "Tus-Resumable": "1.0.0",\n "Tus-Version": "1.0.0",\ndiff --git a/src/plone/restapi/services/content/update.py b/src/plone/restapi/services/content/update.py\nindex b9d697eb..6066985a 100644\n--- a/src/plone/restapi/services/content/update.py\n+++ b/src/plone/restapi/services/content/update.py\n@@ -1,6 +1,7 @@\n # -*- coding: utf-8 -*-\n from plone.restapi.exceptions import DeserializationError\n-from plone.restapi.interfaces import IDeserializeFromJson, ISerializeToJson\n+from plone.restapi.interfaces import IDeserializeFromJson\n+from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.services import Service\n from plone.restapi.services.locking.locking import is_locked\n from zope.component import queryMultiAdapter\ndiff --git a/src/plone/restapi/services/controlpanels/patch.py b/src/plone/restapi/services/controlpanels/patch.py\nindex 5bbcc6e3..8002f98b 100644\n--- a/src/plone/restapi/services/controlpanels/patch.py\n+++ b/src/plone/restapi/services/controlpanels/patch.py\n@@ -2,10 +2,10 @@\n from plone.restapi.controlpanels import IControlpanel\n from plone.restapi.interfaces import IDeserializeFromJson\n from plone.restapi.services import Service\n+from zExceptions import BadRequest\n from zope.component import getAdapters\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n-from zExceptions import BadRequest\n \n \n @implementer(IPublishTraverse)\ndiff --git a/src/plone/restapi/services/copymove/copymove.py b/src/plone/restapi/services/copymove/copymove.py\nindex 05e9374f..bfa11666 100644\n--- a/src/plone/restapi/services/copymove/copymove.py\n+++ b/src/plone/restapi/services/copymove/copymove.py\n@@ -29,7 +29,7 @@ def get_object(self, key):\n if isinstance(key, six.string_types):\n if key.startswith(self.portal_url):\n # Resolve by URL\n- key = key[len(self.portal_url) + 1 :]\n+ key = key[len(self.portal_url) + 1:]\n if six.PY2:\n key = key.encode("utf8")\n return self.portal.restrictedTraverse(key, None)\ndiff --git a/src/plone/restapi/services/discussion/conversation.py b/src/plone/restapi/services/discussion/conversation.py\nindex e9899654..17ab841f 100644\n--- a/src/plone/restapi/services/discussion/conversation.py\n+++ b/src/plone/restapi/services/discussion/conversation.py\n@@ -1,4 +1,5 @@\n # -*- coding: utf-8 -*-\n+from datetime import datetime\n from plone.app.discussion.browser.comment import EditCommentForm\n from plone.app.discussion.browser.comments import CommentForm\n from plone.app.discussion.interfaces import IConversation\n@@ -19,7 +20,6 @@\n from zope.publisher.interfaces import IPublishTraverse\n from zope.security.interfaces import IPermission\n \n-from datetime import datetime\n import plone.protect.interfaces\n \n \ndiff --git a/src/plone/restapi/services/email_send/post.py b/src/plone/restapi/services/email_send/post.py\nindex 61c1f61b..41cfcf42 100644\n--- a/src/plone/restapi/services/email_send/post.py\n+++ b/src/plone/restapi/services/email_send/post.py\n@@ -7,12 +7,12 @@\n from plone.restapi.deserializer import json_body\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n+from Products.CMFPlone.interfaces import ISiteSchema\n from Products.CMFPlone.interfaces.controlpanel import IMailSchema\n from smtplib import SMTPException\n from zope.component import getMultiAdapter\n from zope.component import getUtility\n from zope.interface import alsoProvides\n-from Products.CMFPlone.interfaces import ISiteSchema\n \n import plone\n \ndiff --git a/src/plone/restapi/services/groups/add.py b/src/plone/restapi/services/groups/add.py\nindex 499d821f..825fa498 100644\n--- a/src/plone/restapi/services/groups/add.py\n+++ b/src/plone/restapi/services/groups/add.py\n@@ -3,9 +3,9 @@\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n+from zExceptions import BadRequest\n from zope.component import queryMultiAdapter\n from zope.component.hooks import getSite\n-from zExceptions import BadRequest\n from zope.interface import alsoProvides\n \n import plone.protect.interfaces\ndiff --git a/src/plone/restapi/services/groups/get.py b/src/plone/restapi/services/groups/get.py\nindex d1c5a570..874fa272 100644\n--- a/src/plone/restapi/services/groups/get.py\n+++ b/src/plone/restapi/services/groups/get.py\n@@ -4,11 +4,12 @@\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n from zExceptions import BadRequest\n-from zope.component.hooks import getSite\n from zope.component import queryMultiAdapter\n+from zope.component.hooks import getSite\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n \n+\n DEFAULT_SEARCH_RESULTS_LIMIT = 25\n \n \ndiff --git a/src/plone/restapi/services/groups/update.py b/src/plone/restapi/services/groups/update.py\nindex f25b75ed..00b06a2d 100644\n--- a/src/plone/restapi/services/groups/update.py\n+++ b/src/plone/restapi/services/groups/update.py\n@@ -4,7 +4,8 @@\n from Products.CMFCore.utils import getToolByName\n from zExceptions import BadRequest\n from zope.component.hooks import getSite\n-from zope.interface import alsoProvides, implementer\n+from zope.interface import alsoProvides\n+from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n \n import plone\ndiff --git a/src/plone/restapi/services/history/get.py b/src/plone/restapi/services/history/get.py\nindex cdb5f67b..95f60c99 100644\n--- a/src/plone/restapi/services/history/get.py\n+++ b/src/plone/restapi/services/history/get.py\n@@ -1,14 +1,15 @@\n # -*- coding: utf-8 -*-\n+from datetime import datetime as dt\n from plone.app.layout.viewlets.content import ContentHistoryViewlet\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.serializer.converters import json_compatible\n from plone.restapi.services import Service\n+from Products.CMFPlone.utils import safe_unicode\n from zope.component import queryMultiAdapter\n from zope.component.hooks import getSite\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n-from Products.CMFPlone.utils import safe_unicode\n-from datetime import datetime as dt\n+\n import six\n \n \ndiff --git a/src/plone/restapi/services/history/patch.py b/src/plone/restapi/services/history/patch.py\nindex fe8cf314..9e795407 100644\n--- a/src/plone/restapi/services/history/patch.py\n+++ b/src/plone/restapi/services/history/patch.py\n@@ -1,11 +1,12 @@\n # -*- coding: utf-8 -*-\n+from plone.restapi.deserializer import json_body\n from plone.restapi.serializer.converters import json_compatible\n from plone.restapi.services import Service\n-from plone.restapi.deserializer import json_body\n-from zExceptions import BadRequest\n from Products.CMFCore.utils import getToolByName\n from Products.CMFEditions import CMFEditionsMessageFactory as _\n from Products.CMFEditions.interfaces.IModifier import FileTooLargeToVersionError # noqa\n+from zExceptions import BadRequest\n+\n import six\n \n \ndiff --git a/src/plone/restapi/services/multilingual/pam.py b/src/plone/restapi/services/multilingual/pam.py\nindex 37fa6735..d7773106 100644\n--- a/src/plone/restapi/services/multilingual/pam.py\n+++ b/src/plone/restapi/services/multilingual/pam.py\n@@ -97,7 +97,7 @@ def _traverse(self, url):\n portal = purl.getPortalObject()\n portal_url = portal.absolute_url()\n if url.startswith(portal_url):\n- content_path = url[len(portal_url) + 1 :]\n+ content_path = url[len(portal_url) + 1:]\n content_path = content_path.split("/")\n content_item = portal.restrictedTraverse(content_path)\n return content_item\ndiff --git a/src/plone/restapi/services/navigation/get.py b/src/plone/restapi/services/navigation/get.py\nindex 3bcc0d1e..c34815cd 100644\n--- a/src/plone/restapi/services/navigation/get.py\n+++ b/src/plone/restapi/services/navigation/get.py\n@@ -1,15 +1,15 @@\n # -*- coding: utf-8 -*-\n+from plone.app.layout.navigation.navtree import buildFolderTree\n+from plone.app.layout.navigation.root import getNavigationRoot\n from plone.restapi.interfaces import IExpandableElement\n from plone.restapi.services import Service\n-from zope.component import adapter\n-from zope.component import getMultiAdapter\n-from zope.interface import Interface\n-from zope.interface import implementer\n from Products.CMFPlone.browser.navtree import NavtreeQueryBuilder\n-from plone.app.layout.navigation.navtree import buildFolderTree\n-from plone.app.layout.navigation.root import getNavigationRoot\n from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy\n+from zope.component import adapter\n+from zope.component import getMultiAdapter\n from zope.component.hooks import getSite\n+from zope.interface import implementer\n+from zope.interface import Interface\n \n \n class NavigationTreeQueryBuilder(NavtreeQueryBuilder):\n@@ -51,7 +51,7 @@ def getRootPath(self, topLevel=1):\n contextPath = "/".join(self.context.getPhysicalPath())\n if not contextPath.startswith(rootPath):\n return None\n- contextSubPathElements = contextPath[len(rootPath) + 1 :]\n+ contextSubPathElements = contextPath[len(rootPath) + 1:]\n if contextSubPathElements:\n contextSubPathElements = contextSubPathElements.split("/")\n if len(contextSubPathElements) < topLevel:\ndiff --git a/src/plone/restapi/services/registry/get.py b/src/plone/restapi/services/registry/get.py\nindex 649ff88d..cf39a82f 100644\n--- a/src/plone/restapi/services/registry/get.py\n+++ b/src/plone/restapi/services/registry/get.py\n@@ -1,10 +1,11 @@\n # -*- coding: utf-8 -*-\n from plone.registry.interfaces import IRegistry\n+from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.services import Service\n-from zope.component import getUtility, getMultiAdapter\n+from zope.component import getMultiAdapter\n+from zope.component import getUtility\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n-from plone.restapi.interfaces import ISerializeToJson\n \n \n @implementer(IPublishTraverse)\ndiff --git a/src/plone/restapi/services/tiles/get.py b/src/plone/restapi/services/tiles/get.py\nindex bc2541da..06549945 100644\n--- a/src/plone/restapi/services/tiles/get.py\n+++ b/src/plone/restapi/services/tiles/get.py\n@@ -1,14 +1,14 @@\n # -*- coding: utf-8 -*-\n-from plone.restapi.services import Service\n from AccessControl.security import checkPermission\n-from zope.component import getUtilitiesFor\n-from zope.component import getMultiAdapter\n-from plone.tiles.interfaces import ITileType\n-from plone.restapi.interfaces import ISerializeToJsonSummary\n from plone.restapi.interfaces import ISerializeToJson\n+from plone.restapi.interfaces import ISerializeToJsonSummary\n+from plone.restapi.services import Service\n+from plone.tiles.interfaces import ITileType\n+from zope.component import getMultiAdapter\n+from zope.component import getUtilitiesFor\n+from zope.component import getUtility\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n-from zope.component import getUtility\n \n \n @implementer(IPublishTraverse)\ndiff --git a/src/plone/restapi/services/users/add.py b/src/plone/restapi/services/users/add.py\nindex 6faf296e..9c213ffb 100644\n--- a/src/plone/restapi/services/users/add.py\n+++ b/src/plone/restapi/services/users/add.py\n@@ -19,6 +19,7 @@\n \n import plone.protect.interfaces\n \n+\n try: # pragma: no cover\n from Products.CMFPlone.interfaces import ISecuritySchema\n except ImportError: # pragma: no cover\ndiff --git a/src/plone/restapi/services/users/get.py b/src/plone/restapi/services/users/get.py\nindex d548ca71..734bce7a 100644\n--- a/src/plone/restapi/services/users/get.py\n+++ b/src/plone/restapi/services/users/get.py\n@@ -4,11 +4,12 @@\n from plone.restapi.services import Service\n from Products.CMFCore.utils import getToolByName\n from zExceptions import BadRequest\n-from zope.component.hooks import getSite\n from zope.component import queryMultiAdapter\n+from zope.component.hooks import getSite\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n \n+\n DEFAULT_SEARCH_RESULTS_LIMIT = 25\n \n \ndiff --git a/src/plone/restapi/services/vocabularies/get.py b/src/plone/restapi/services/vocabularies/get.py\nindex 3ebe5abe..3a51519f 100644\n--- a/src/plone/restapi/services/vocabularies/get.py\n+++ b/src/plone/restapi/services/vocabularies/get.py\n@@ -3,11 +3,11 @@\n from plone.restapi.services import Service\n from zope.component import ComponentLookupError\n from zope.component import getMultiAdapter\n+from zope.component import getUtilitiesFor\n from zope.component import getUtility\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n from zope.schema.interfaces import IVocabularyFactory\n-from zope.component import getUtilitiesFor\n \n \n @implementer(IPublishTraverse)\ndiff --git a/src/plone/restapi/services/workflow/info.py b/src/plone/restapi/services/workflow/info.py\nindex 13b828b8..be6b3305 100644\n--- a/src/plone/restapi/services/workflow/info.py\n+++ b/src/plone/restapi/services/workflow/info.py\n@@ -1,14 +1,15 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.WorkflowCore import WorkflowException\n-from Products.CMFCore.utils import getToolByName\n-from Products.CMFCore.interfaces._content import IWorkflowAware\n-from Products.CMFPlone.interfaces import IPloneSiteRoot\n from plone.restapi.interfaces import IExpandableElement\n from plone.restapi.serializer.converters import json_compatible\n from plone.restapi.services import Service\n+from Products.CMFCore.interfaces._content import IWorkflowAware\n+from Products.CMFCore.utils import getToolByName\n+from Products.CMFCore.WorkflowCore import WorkflowException\n+from Products.CMFPlone.interfaces import IPloneSiteRoot\n from zope.component import adapter\n-from zope.interface import Interface\n from zope.interface import implementer\n+from zope.interface import Interface\n+\n import six\n \n \ndiff --git a/src/plone/restapi/services/workflow/transition.py b/src/plone/restapi/services/workflow/transition.py\nindex 4897b03d..6f17989f 100644\n--- a/src/plone/restapi/services/workflow/transition.py\n+++ b/src/plone/restapi/services/workflow/transition.py\n@@ -1,7 +1,6 @@\n # -*- coding: utf-8 -*-\n \n-import six\n-\n+from DateTime import DateTime\n from plone.restapi.deserializer import json_body\n from plone.restapi.interfaces import IDeserializeFromJson\n from plone.restapi.serializer.converters import json_compatible\n@@ -16,9 +15,9 @@\n from zope.interface import implementer\n from zope.publisher.interfaces import IPublishTraverse\n from zope.publisher.interfaces import NotFound\n-from DateTime import DateTime\n \n import plone.protect.interfaces\n+import six\n \n \n @implementer(IPublishTraverse)\n@@ -106,7 +105,7 @@ def recurse_transition(\n )\n deserializer(data=publication_dates)\n \n- if obj.EffectiveDate() == \'None\':\n+ if obj.EffectiveDate() == "None":\n obj.setEffectiveDate(DateTime())\n obj.reindexObject()\n \ndiff --git a/src/plone/restapi/tests/attypes.py b/src/plone/restapi/tests/attypes.py\nindex 7a76ba43..1c6f1008 100644\n--- a/src/plone/restapi/tests/attypes.py\n+++ b/src/plone/restapi/tests/attypes.py\n@@ -1,14 +1,15 @@\n # -*- coding: utf-8 -*-\n-from Products.ATContentTypes.content.base import registerATCT\n-from Products.ATContentTypes.content.document import ATDocumentBase\n-from Products.ATContentTypes.content.document import ATDocumentSchema\n-from Products.Archetypes import atapi\n-from Products.CMFCore import permissions\n from plone.app.blob.field import BlobField\n from plone.app.blob.field import FileField\n from plone.app.blob.field import ImageField\n from plone.app.folder.folder import ATFolder\n from plone.app.folder.folder import ATFolderSchema\n+from Products.Archetypes import atapi\n+from Products.ATContentTypes.content.base import registerATCT\n+from Products.ATContentTypes.content.document import ATDocumentBase\n+from Products.ATContentTypes.content.document import ATDocumentSchema\n+from Products.CMFCore import permissions\n+\n \n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\ndiff --git a/src/plone/restapi/tests/dxtypes.py b/src/plone/restapi/tests/dxtypes.py\nindex e4f7c301..34c2a026 100644\n--- a/src/plone/restapi/tests/dxtypes.py\n+++ b/src/plone/restapi/tests/dxtypes.py\n@@ -1,5 +1,4 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n from datetime import datetime\n from datetime import time\n from datetime import timedelta\n@@ -11,6 +10,7 @@\n from plone.dexterity.content import Item\n from plone.namedfile import field as namedfile\n from plone.supermodel import model\n+from Products.CMFCore.utils import getToolByName\n from pytz import timezone\n from z3c.relationfield.schema import RelationChoice\n from z3c.relationfield.schema import RelationList\ndiff --git a/src/plone/restapi/tests/mixin_ordering.py b/src/plone/restapi/tests/mixin_ordering.py\nindex 240f0137..365eff43 100644\n--- a/src/plone/restapi/tests/mixin_ordering.py\n+++ b/src/plone/restapi/tests/mixin_ordering.py\n@@ -1,8 +1,8 @@\n # -*- coding: utf-8 -*-\n-import json\n-\n from zExceptions import BadRequest\n \n+import json\n+\n \n class OrderingMixin:\n # This assumes there is a self.folder with 9 documents in it.\ndiff --git a/src/plone/restapi/tests/performance.py b/src/plone/restapi/tests/performance.py\nindex 776064aa..75ee3c28 100644\n--- a/src/plone/restapi/tests/performance.py\n+++ b/src/plone/restapi/tests/performance.py\n@@ -1,13 +1,14 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n-from zope.component.hooks import getSite\n from datetime import datetime\n from plone.app.textfield.value import RichTextValue\n from plone.dexterity.interfaces import IDexterityContent\n+from Products.CMFCore.utils import getToolByName\n+from six.moves import range\n+from zope.component.hooks import getSite\n \n import os\n import pytz\n-from six.moves import range\n+\n \n LOREMIPSUM_HTML_10_PARAGRAPHS = """

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.

Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.""" # noqa\n \ndiff --git a/src/plone/restapi/tests/test_atcollection.py b/src/plone/restapi/tests/test_atcollection.py\nindex f155aa8a..7285535b 100644\n--- a/src/plone/restapi/tests/test_atcollection.py\n+++ b/src/plone/restapi/tests/test_atcollection.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n from DateTime import DateTime\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import setRoles\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.testing import HAS_AT\n from plone.restapi.testing import PLONE_RESTAPI_AT_INTEGRATION_TESTING\ndiff --git a/src/plone/restapi/tests/test_atcontent_deserializer.py b/src/plone/restapi/tests/test_atcontent_deserializer.py\nindex aee241d8..49970e44 100644\n--- a/src/plone/restapi/tests/test_atcontent_deserializer.py\n+++ b/src/plone/restapi/tests/test_atcontent_deserializer.py\n@@ -1,19 +1,20 @@\n # -*- coding: utf-8 -*-\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import setRoles\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.interfaces import IDeserializeFromJson\n from plone.restapi.testing import HAS_AT\n from plone.restapi.testing import PLONE_RESTAPI_AT_INTEGRATION_TESTING\n from plone.restapi.tests.mixin_ordering import OrderingMixin\n+from six.moves import range\n from zExceptions import BadRequest\n+from zope.component import adapter\n from zope.component import getMultiAdapter\n from zope.component import provideHandler\n from zope.component import provideSubscriptionAdapter\n-from zope.component import adapter\n from zope.interface import implementer\n \n import unittest\n-from six.moves import range\n+\n \n if HAS_AT:\n from plone.restapi.deserializer.atcontent import ValidationRequest\ndiff --git a/src/plone/restapi/tests/test_atcontent_serializer.py b/src/plone/restapi/tests/test_atcontent_serializer.py\nindex 407e333b..75590a56 100644\n--- a/src/plone/restapi/tests/test_atcontent_serializer.py\n+++ b/src/plone/restapi/tests/test_atcontent_serializer.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n from DateTime import DateTime\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import setRoles\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.interfaces import IExpandableElement\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.testing import HAS_AT\ndiff --git a/src/plone/restapi/tests/test_atfield_deserializer.py b/src/plone/restapi/tests/test_atfield_deserializer.py\nindex 3e880f66..ed3ae4bb 100644\n--- a/src/plone/restapi/tests/test_atfield_deserializer.py\n+++ b/src/plone/restapi/tests/test_atfield_deserializer.py\n@@ -1,13 +1,13 @@\n # -*- coding: utf-8 -*-\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import setRoles\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.interfaces import IFieldDeserializer\n from plone.restapi.testing import HAS_AT\n from plone.restapi.testing import PLONE_RESTAPI_AT_INTEGRATION_TESTING\n from zope.component import getMultiAdapter\n \n-import unittest\n import six\n+import unittest\n \n \n class TestATFieldDeserializer(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_atfield_serializer.py b/src/plone/restapi/tests/test_atfield_serializer.py\nindex 6ca6fa28..6f769319 100644\n--- a/src/plone/restapi/tests/test_atfield_serializer.py\n+++ b/src/plone/restapi/tests/test_atfield_serializer.py\n@@ -11,8 +11,9 @@\n from zope.component import getMultiAdapter\n \n import os\n-import unittest\n import six\n+import unittest\n+\n \n if PLONE_VERSION.base_version >= "5.1":\n GIF_SCALE_FORMAT = "png"\ndiff --git a/src/plone/restapi/tests/test_auth.py b/src/plone/restapi/tests/test_auth.py\nindex f66cda27..01e602e2 100644\n--- a/src/plone/restapi/tests/test_auth.py\n+++ b/src/plone/restapi/tests/test_auth.py\n@@ -1,12 +1,12 @@\n # -*- coding: utf-8 -*-\n-from ZPublisher.pubevents import PubStart\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.restapi.permissions import UseRESTAPI\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from unittest import TestCase\n-from zope.event import notify\n from zExceptions import Unauthorized\n+from zope.event import notify\n+from ZPublisher.pubevents import PubStart\n \n \n class TestLogin(TestCase):\ndiff --git a/src/plone/restapi/tests/test_batching.py b/src/plone/restapi/tests/test_batching.py\nindex 9159aa72..006511a7 100644\n--- a/src/plone/restapi/tests/test_batching.py\n+++ b/src/plone/restapi/tests/test_batching.py\n@@ -13,12 +13,12 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from plone.restapi.testing import RelativeSession\n from plone.restapi.tests.helpers import result_paths\n+from six.moves import range\n from six.moves.urllib.parse import parse_qsl\n from six.moves.urllib.parse import urlparse\n \n import transaction\n import unittest\n-from six.moves import range\n \n \n class TestBatchingDXBase(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_boolean_value.py b/src/plone/restapi/tests/test_boolean_value.py\nindex 72c308c0..b3fbee36 100644\n--- a/src/plone/restapi/tests/test_boolean_value.py\n+++ b/src/plone/restapi/tests/test_boolean_value.py\n@@ -1,9 +1,9 @@\n # -*- coding: utf-8 -*-\n-import unittest\n-\n from plone.restapi.deserializer import boolean_value\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n \n+import unittest\n+\n \n class TestBooleanValue(unittest.TestCase):\n \ndiff --git a/src/plone/restapi/tests/test_comments.py b/src/plone/restapi/tests/test_comments.py\nindex 64cfdb20..bc4622bb 100644\n--- a/src/plone/restapi/tests/test_comments.py\n+++ b/src/plone/restapi/tests/test_comments.py\n@@ -1,19 +1,16 @@\n # -*- coding: utf-8 -*-\n-from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n-from unittest import TestCase\n-from zope.component import getMultiAdapter\n-\n-from plone.restapi.interfaces import ISerializeToJson\n-from plone.app.discussion.interfaces import IDiscussionSettings\n+from plone import api\n from plone.app.discussion.interfaces import IConversation\n+from plone.app.discussion.interfaces import IDiscussionSettings\n from plone.app.discussion.interfaces import IReplies\n from plone.registry.interfaces import IRegistry\n-\n+from plone.restapi.interfaces import ISerializeToJson\n+from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n+from unittest import TestCase\n from zope.component import createObject\n+from zope.component import getMultiAdapter\n from zope.component import getUtility\n \n-from plone import api\n-\n \n class TestCommentsSerializers(TestCase):\n layer = PLONE_RESTAPI_DX_INTEGRATION_TESTING\ndiff --git a/src/plone/restapi/tests/test_content_delete.py b/src/plone/restapi/tests/test_content_delete.py\nindex fdaab9fd..8305acde 100644\n--- a/src/plone/restapi/tests/test_content_delete.py\n+++ b/src/plone/restapi/tests/test_content_delete.py\n@@ -1,24 +1,25 @@\n # -*- coding: utf-8 -*-\n-from ZPublisher.pubevents import PubStart\n from base64 import b64encode\n from pkg_resources import get_distribution\n from pkg_resources import parse_version\n+from plone.app.testing import login\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n from plone.app.testing import TEST_USER_NAME\n from plone.app.testing import TEST_USER_PASSWORD\n-from plone.app.testing import login\n-from plone.app.testing import setRoles\n from plone.restapi.testing import HAS_AT\n from plone.restapi.testing import PLONE_RESTAPI_AT_INTEGRATION_TESTING\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from zope.event import notify\n+from ZPublisher.pubevents import PubStart\n \n import requests\n import transaction\n import unittest\n \n+\n linkintegrity_version = get_distribution("plone.app.linkintegrity").version\n if parse_version(linkintegrity_version) >= parse_version("3.0.dev0"):\n NEW_LINKINTEGRITY = True\ndiff --git a/src/plone/restapi/tests/test_content_get.py b/src/plone/restapi/tests/test_content_get.py\nindex 3c38c829..d87ed540 100644\n--- a/src/plone/restapi/tests/test_content_get.py\n+++ b/src/plone/restapi/tests/test_content_get.py\n@@ -1,14 +1,14 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n+from plone.app.testing import login\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n-from plone.app.testing import login\n-from plone.app.testing import setRoles\n from plone.app.textfield.value import RichTextValue\n from plone.restapi.testing import HAS_AT\n from plone.restapi.testing import PLONE_RESTAPI_AT_FUNCTIONAL_TESTING\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n+from Products.CMFCore.utils import getToolByName\n from z3c.relationfield import RelationValue\n from zope.component import getUtility\n from zope.intid.interfaces import IIntIds\ndiff --git a/src/plone/restapi/tests/test_content_local_roles.py b/src/plone/restapi/tests/test_content_local_roles.py\nindex 608498e4..9e827929 100644\n--- a/src/plone/restapi/tests/test_content_local_roles.py\n+++ b/src/plone/restapi/tests/test_content_local_roles.py\n@@ -1,14 +1,14 @@\n # -*- coding: utf-8 -*-\n from Acquisition import aq_base\n-from Products.CMFCore.utils import getToolByName\n from plone import api\n+from plone.app.testing import login\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n-from plone.app.testing import login\n-from plone.app.testing import setRoles\n from plone.restapi.serializer.local_roles import SerializeLocalRolesToJson\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n+from Products.CMFCore.utils import getToolByName\n from zope.component import getGlobalSiteManager\n \n import requests\ndiff --git a/src/plone/restapi/tests/test_copymove.py b/src/plone/restapi/tests/test_copymove.py\nindex 8c610347..0a03089a 100644\n--- a/src/plone/restapi/tests/test_copymove.py\n+++ b/src/plone/restapi/tests/test_copymove.py\n@@ -1,18 +1,18 @@\n # -*- coding: utf-8 -*-\n-from plone import api\n-from ZPublisher.pubevents import PubStart\n from base64 import b64encode\n+from plone import api\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n-from plone.app.testing import setRoles\n-from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n+from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from plone.restapi.testing import RelativeSession\n from zope.event import notify\n+from ZPublisher.pubevents import PubStart\n \n-import unittest\n import transaction\n+import unittest\n \n \n class TestCopyMove(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_documentation.py b/src/plone/restapi/tests/test_documentation.py\nindex b18064b9..a9bda9ff 100644\n--- a/src/plone/restapi/tests/test_documentation.py\n+++ b/src/plone/restapi/tests/test_documentation.py\n@@ -1,8 +1,8 @@\n # -*- coding: utf-8 -*-\n from base64 import b64encode\n from datetime import datetime\n-from DateTime import DateTime\n from datetime import timedelta\n+from DateTime import DateTime\n from freezegun import freeze_time\n from mock import patch\n from pkg_resources import parse_version\n@@ -24,15 +24,14 @@\n from plone.namedfile.file import NamedBlobFile\n from plone.namedfile.file import NamedBlobImage\n from plone.registry.interfaces import IRegistry\n-from plone.restapi.testing import PAM_INSTALLED\n+from plone.restapi.testing import PAM_INSTALLED # noqa\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING_FREEZETIME # noqa\n-from plone.restapi.testing import (\n- PLONE_RESTAPI_DX_PAM_FUNCTIONAL_TESTING_FREEZETIME,\n-) # noqa\n+from plone.restapi.testing import PLONE_RESTAPI_DX_PAM_FUNCTIONAL_TESTING_FREEZETIME\n from plone.restapi.testing import register_static_uuid_utility\n from plone.restapi.testing import RelativeSession\n from plone.scale import storage\n from plone.testing.z2 import Browser\n+from six.moves import range\n from zope.component import createObject\n from zope.component import getUtility\n from zope.interface import alsoProvides\n@@ -45,7 +44,7 @@\n import six\n import transaction\n import unittest\n-from six.moves import range\n+\n \n if PAM_INSTALLED:\n from plone.app.multilingual.interfaces import ITranslationManager\ndiff --git a/src/plone/restapi/tests/test_dxcontent_deserializer.py b/src/plone/restapi/tests/test_dxcontent_deserializer.py\nindex 223dbfdc..d80c5f71 100644\n--- a/src/plone/restapi/tests/test_dxcontent_deserializer.py\n+++ b/src/plone/restapi/tests/test_dxcontent_deserializer.py\n@@ -1,6 +1,6 @@\n # -*- coding: utf-8 -*-\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import setRoles\n+from plone.app.testing import TEST_USER_ID\n from plone.dexterity.interfaces import IDexterityItem\n from plone.restapi.exceptions import DeserializationError\n from plone.restapi.interfaces import IDeserializeFromJson\n@@ -8,15 +8,15 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from plone.restapi.tests.dxtypes import ITestAnnotationsBehavior\n from plone.restapi.tests.mixin_ordering import OrderingMixin\n+from six.moves import range\n from zExceptions import BadRequest\n from zope.component import getMultiAdapter\n from zope.component import provideHandler\n from zope.lifecycleevent.interfaces import IObjectModifiedEvent\n \n import json\n-import unittest\n import six\n-from six.moves import range\n+import unittest\n \n \n class TestDXContentDeserializer(unittest.TestCase, OrderingMixin):\ndiff --git a/src/plone/restapi/tests/test_dxcontent_serializer.py b/src/plone/restapi/tests/test_dxcontent_serializer.py\nindex 7382ba83..301b0e00 100644\n--- a/src/plone/restapi/tests/test_dxcontent_serializer.py\n+++ b/src/plone/restapi/tests/test_dxcontent_serializer.py\n@@ -1,9 +1,9 @@\n # -*- coding: utf-8 -*-\n-from DateTime import DateTime\n from datetime import date\n from datetime import datetime\n from datetime import time\n from datetime import timedelta\n+from DateTime import DateTime\n from plone.app.discussion.interfaces import IDiscussionSettings\n from plone.app.testing import setRoles\n from plone.app.testing import TEST_USER_ID\ndiff --git a/src/plone/restapi/tests/test_dxfield_deserializer.py b/src/plone/restapi/tests/test_dxfield_deserializer.py\nindex 27711f79..cb12aa16 100644\n--- a/src/plone/restapi/tests/test_dxfield_deserializer.py\n+++ b/src/plone/restapi/tests/test_dxfield_deserializer.py\n@@ -9,17 +9,16 @@\n from plone.dexterity.utils import iterSchemata\n from plone.restapi.interfaces import IFieldDeserializer\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n-from pytz import timezone\n-\n from plone.restapi.tests.dxtypes import IDXTestDocumentSchema\n+from pytz import timezone\n from zope.component import getMultiAdapter\n-from zope.schema.interfaces import ConstraintNotSatisfied\n from zope.schema import Field\n from zope.schema._bootstrapinterfaces import RequiredMissing\n+from zope.schema.interfaces import ConstraintNotSatisfied\n from zope.schema.interfaces import ValidationError\n \n-import unittest\n import six\n+import unittest\n \n \n class RequiredField(object):\ndiff --git a/src/plone/restapi/tests/test_dxfield_serializer.py b/src/plone/restapi/tests/test_dxfield_serializer.py\nindex 04edd751..cd6b04f1 100644\n--- a/src/plone/restapi/tests/test_dxfield_serializer.py\n+++ b/src/plone/restapi/tests/test_dxfield_serializer.py\n@@ -23,6 +23,7 @@\n import os\n import six\n \n+\n if PLONE_VERSION.base_version >= "5.1":\n GIF_SCALE_FORMAT = "png"\n else:\ndiff --git a/src/plone/restapi/tests/test_error_handling.py b/src/plone/restapi/tests/test_error_handling.py\nindex 37cca4d8..f6852341 100644\n--- a/src/plone/restapi/tests/test_error_handling.py\n+++ b/src/plone/restapi/tests/test_error_handling.py\n@@ -1,8 +1,8 @@\n # -*- coding: utf-8 -*-\n from plone.app.testing import setRoles\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n from Products.Five.browser import BrowserView\ndiff --git a/src/plone/restapi/tests/test_expansion.py b/src/plone/restapi/tests/test_expansion.py\nindex e372be25..13274ab7 100644\n--- a/src/plone/restapi/tests/test_expansion.py\n+++ b/src/plone/restapi/tests/test_expansion.py\n@@ -21,6 +21,7 @@\n import transaction\n import unittest\n \n+\n if PAM_INSTALLED:\n from plone.app.multilingual.interfaces import IPloneAppMultilingualInstalled # noqa\n from plone.app.multilingual.interfaces import ITranslationManager\ndiff --git a/src/plone/restapi/tests/test_functional_auth.py b/src/plone/restapi/tests/test_functional_auth.py\nindex 9a9972a1..98bda6eb 100644\n--- a/src/plone/restapi/tests/test_functional_auth.py\n+++ b/src/plone/restapi/tests/test_functional_auth.py\n@@ -1,10 +1,10 @@\n # -*- coding: utf-8 -*-\n+from plone.app.testing import login\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import TEST_USER_ID\n from plone.app.testing import TEST_USER_NAME\n from plone.app.testing import TEST_USER_PASSWORD\n-from plone.app.testing import login\n-from plone.app.testing import setRoles\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n \n import requests\ndiff --git a/src/plone/restapi/tests/test_locking.py b/src/plone/restapi/tests/test_locking.py\nindex c738dca4..9d699b06 100644\n--- a/src/plone/restapi/tests/test_locking.py\n+++ b/src/plone/restapi/tests/test_locking.py\n@@ -1,17 +1,16 @@\n # -*- coding: utf-8 -*-\n+from plone.app.testing import login\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n-from plone.app.testing import login\n+from plone.locking.interfaces import ILockable\n+from plone.locking.interfaces import INonStealableLock\n from plone.locking.interfaces import ITTWLockable\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n from zope.interface import alsoProvides\n-from plone.locking.interfaces import ILockable\n-from plone.locking.interfaces import INonStealableLock\n-\n \n-import unittest\n import transaction\n+import unittest\n \n \n class TestLocking(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_pas.py b/src/plone/restapi/tests/test_pas.py\nindex a9a2f7ae..822216c7 100644\n--- a/src/plone/restapi/tests/test_pas.py\n+++ b/src/plone/restapi/tests/test_pas.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.utils import getToolByName\n from plone.keyring.interfaces import IKeyManager\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n+from Products.CMFCore.utils import getToolByName\n from zope.component import getUtility\n \n import unittest\ndiff --git a/src/plone/restapi/tests/test_permissions.py b/src/plone/restapi/tests/test_permissions.py\nindex 80fe21f2..bb381db4 100644\n--- a/src/plone/restapi/tests/test_permissions.py\n+++ b/src/plone/restapi/tests/test_permissions.py\n@@ -7,8 +7,8 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n \n-import unittest\n import transaction\n+import unittest\n \n \n class TestPermissions(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_profile_tiles.py b/src/plone/restapi/tests/test_profile_tiles.py\nindex 8875cf07..22748ff3 100644\n--- a/src/plone/restapi/tests/test_profile_tiles.py\n+++ b/src/plone/restapi/tests/test_profile_tiles.py\n@@ -1,10 +1,10 @@\n # -*- coding: utf-8 -*-\n-from plone.app.testing import SITE_OWNER_NAME\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import login\n from plone.app.testing import setRoles\n-from plone.restapi.testing import PLONE_RESTAPI_TILES_INTEGRATION_TESTING\n+from plone.app.testing import SITE_OWNER_NAME\n+from plone.app.testing import TEST_USER_ID\n from plone.restapi.behaviors import ITiles\n+from plone.restapi.testing import PLONE_RESTAPI_TILES_INTEGRATION_TESTING\n from Products.CMFCore.utils import getToolByName\n \n import unittest\ndiff --git a/src/plone/restapi/tests/test_query_parsers.py b/src/plone/restapi/tests/test_query_parsers.py\nindex c3369614..fcd55afb 100644\n--- a/src/plone/restapi/tests/test_query_parsers.py\n+++ b/src/plone/restapi/tests/test_query_parsers.py\n@@ -10,6 +10,7 @@\n from plone.restapi.search.query import KeywordIndexQueryParser\n from plone.restapi.search.query import UUIDIndexQueryParser\n from plone.restapi.search.query import ZCTextIndexQueryParser\n+\n import unittest\n \n \ndiff --git a/src/plone/restapi/tests/test_registry.py b/src/plone/restapi/tests/test_registry.py\nindex 3f76ba74..14b1803c 100644\n--- a/src/plone/restapi/tests/test_registry.py\n+++ b/src/plone/restapi/tests/test_registry.py\n@@ -8,11 +8,11 @@\n from plone.registry.record import Record\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n+from six.moves import range\n from zope.component import getUtility\n \n import transaction\n import unittest\n-from six.moves import range\n \n \n class TestRegistry(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_registry_serializer.py b/src/plone/restapi/tests/test_registry_serializer.py\nindex 76b0e769..b4f2065c 100644\n--- a/src/plone/restapi/tests/test_registry_serializer.py\n+++ b/src/plone/restapi/tests/test_registry_serializer.py\n@@ -1,14 +1,14 @@\n # -*- coding: utf-8 -*-\n-from plone.registry import Registry\n from plone.registry import field\n+from plone.registry import Registry\n from plone.registry.record import Record\n from plone.restapi import HAS_AT\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.testing import PLONE_RESTAPI_AT_INTEGRATION_TESTING\n+from six.moves import range\n from zope.component import getMultiAdapter\n \n import unittest\n-from six.moves import range\n \n \n class TestRegistrySerializer(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_serializer_converters.py b/src/plone/restapi/tests/test_serializer_converters.py\nindex d53d5dec..55530680 100644\n--- a/src/plone/restapi/tests/test_serializer_converters.py\n+++ b/src/plone/restapi/tests/test_serializer_converters.py\n@@ -1,8 +1,8 @@\n # -*- coding: utf-8 -*-\n from datetime import date\n-from DateTime import DateTime\n from datetime import time\n from datetime import timedelta\n+from DateTime import DateTime\n from persistent.list import PersistentList\n from persistent.mapping import PersistentMapping\n from plone.restapi.serializer.converters import json_compatible\ndiff --git a/src/plone/restapi/tests/test_services.py b/src/plone/restapi/tests/test_services.py\nindex 4b630309..68d58637 100644\n--- a/src/plone/restapi/tests/test_services.py\n+++ b/src/plone/restapi/tests/test_services.py\n@@ -14,9 +14,9 @@\n from zope.component import getUtility\n from zope.intid.interfaces import IIntIds\n \n-import unittest\n import os\n import transaction\n+import unittest\n \n \n class TestTraversal(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_services_actions.py b/src/plone/restapi/tests/test_services_actions.py\nindex 5a16a7b6..21dc8a27 100644\n--- a/src/plone/restapi/tests/test_services_actions.py\n+++ b/src/plone/restapi/tests/test_services_actions.py\n@@ -1,7 +1,4 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.ActionInformation import Action\n-from Products.CMFCore.ActionInformation import ActionCategory\n-from Products.CMFCore import permissions\n from plone import api\n from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n@@ -9,6 +6,9 @@\n from plone.app.testing import TEST_USER_ID\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n+from Products.CMFCore import permissions\n+from Products.CMFCore.ActionInformation import Action\n+from Products.CMFCore.ActionInformation import ActionCategory\n \n import transaction\n import unittest\ndiff --git a/src/plone/restapi/tests/test_services_comments.py b/src/plone/restapi/tests/test_services_comments.py\nindex 4a8e134f..0243acae 100644\n--- a/src/plone/restapi/tests/test_services_comments.py\n+++ b/src/plone/restapi/tests/test_services_comments.py\n@@ -1,13 +1,11 @@\n # -*- coding: utf-8 -*-\n from plone import api\n+from plone.app.discussion.interfaces import IDiscussionSettings\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.registry.interfaces import IRegistry\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n-\n-from plone.app.discussion.interfaces import IDiscussionSettings\n-\n from zope.component import getUtility\n \n import transaction\ndiff --git a/src/plone/restapi/tests/test_services_content.py b/src/plone/restapi/tests/test_services_content.py\nindex fe6ba842..23fb7891 100644\n--- a/src/plone/restapi/tests/test_services_content.py\n+++ b/src/plone/restapi/tests/test_services_content.py\n@@ -1,13 +1,13 @@\n # -*- coding: utf-8 -*-\n-from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n-from plone.restapi.testing import RelativeSession\n from plone.app.testing import setRoles\n-from plone.app.testing import TEST_USER_ID\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n+from plone.app.testing import TEST_USER_ID\n+from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n+from plone.restapi.testing import RelativeSession\n \n-import unittest\n import transaction\n+import unittest\n \n \n class TestHistoryVersioning(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_services_controlpanels.py b/src/plone/restapi/tests/test_services_controlpanels.py\nindex cda2cebc..15c0834d 100644\n--- a/src/plone/restapi/tests/test_services_controlpanels.py\n+++ b/src/plone/restapi/tests/test_services_controlpanels.py\n@@ -8,6 +8,7 @@\n \n import unittest\n \n+\n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\n except ImportError:\ndiff --git a/src/plone/restapi/tests/test_services_email_notification.py b/src/plone/restapi/tests/test_services_email_notification.py\nindex a0b05b80..60a729b1 100644\n--- a/src/plone/restapi/tests/test_services_email_notification.py\n+++ b/src/plone/restapi/tests/test_services_email_notification.py\n@@ -1,18 +1,18 @@\n # -*- coding: utf-8 -*-\n-from Products.MailHost.interfaces import IMailHost\n-\n from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n+from plone.registry.interfaces import IRegistry\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n+from Products.MailHost.interfaces import IMailHost\n from zope.component import getUtility\n-from plone.registry.interfaces import IRegistry\n \n import transaction\n import unittest\n \n+\n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\n except ImportError:\ndiff --git a/src/plone/restapi/tests/test_services_email_send.py b/src/plone/restapi/tests/test_services_email_send.py\nindex 2d24eb01..15669f0a 100644\n--- a/src/plone/restapi/tests/test_services_email_send.py\n+++ b/src/plone/restapi/tests/test_services_email_send.py\n@@ -1,18 +1,18 @@\n # -*- coding: utf-8 -*-\n-from Products.MailHost.interfaces import IMailHost\n-\n from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n+from plone.registry.interfaces import IRegistry\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n+from Products.MailHost.interfaces import IMailHost\n from zope.component import getUtility\n-from plone.registry.interfaces import IRegistry\n \n import transaction\n import unittest\n \n+\n try:\n from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa\n except ImportError:\ndiff --git a/src/plone/restapi/tests/test_services_history.py b/src/plone/restapi/tests/test_services_history.py\nindex e4d2f0e8..a3ade88c 100644\n--- a/src/plone/restapi/tests/test_services_history.py\n+++ b/src/plone/restapi/tests/test_services_history.py\n@@ -7,9 +7,9 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n \n-import unittest\n-import transaction\n import six\n+import transaction\n+import unittest\n \n \n class TestHistoryEndpoint(unittest.TestCase):\ndiff --git a/src/plone/restapi/tests/test_services_types.py b/src/plone/restapi/tests/test_services_types.py\nindex 9ef8357c..388b82b1 100644\n--- a/src/plone/restapi/tests/test_services_types.py\n+++ b/src/plone/restapi/tests/test_services_types.py\n@@ -7,7 +7,6 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n \n-\n import transaction\n import unittest\n \ndiff --git a/src/plone/restapi/tests/test_services_users.py b/src/plone/restapi/tests/test_services_users.py\nindex 186f067b..8e8fa051 100644\n--- a/src/plone/restapi/tests/test_services_users.py\n+++ b/src/plone/restapi/tests/test_services_users.py\n@@ -1,8 +1,4 @@\n # -*- coding: utf-8 -*-\n-from Products.CMFCore.permissions import SetOwnPassword\n-from Products.CMFCore.utils import getToolByName\n-from Products.MailHost.interfaces import IMailHost\n-\n from plone import api\n from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n@@ -10,17 +6,21 @@\n from plone.app.testing import TEST_USER_ID\n from plone.restapi.testing import PLONE_RESTAPI_DX_FUNCTIONAL_TESTING\n from plone.restapi.testing import RelativeSession\n+from Products.CMFCore.permissions import SetOwnPassword\n+from Products.CMFCore.utils import getToolByName\n+from Products.MailHost.interfaces import IMailHost\n from zope.component import getAdapter\n from zope.component import getUtility\n \n+import transaction\n+import unittest\n+\n+\n try:\n from Products.CMFPlone.interfaces import ISecuritySchema\n except ImportError:\n from plone.app.controlpanel.security import ISecuritySchema\n \n-import transaction\n-import unittest\n-\n \n class TestUsersEndpoint(unittest.TestCase):\n \ndiff --git a/src/plone/restapi/tests/test_services_vocabularies.py b/src/plone/restapi/tests/test_services_vocabularies.py\nindex 3110f70f..9208712f 100644\n--- a/src/plone/restapi/tests/test_services_vocabularies.py\n+++ b/src/plone/restapi/tests/test_services_vocabularies.py\n@@ -10,8 +10,8 @@\n from zope.component import provideUtility\n from zope.componentvocabulary.vocabulary import UtilityTerm\n from zope.schema.interfaces import IVocabularyFactory\n-from zope.schema.vocabulary import SimpleVocabulary\n from zope.schema.vocabulary import SimpleTerm\n+from zope.schema.vocabulary import SimpleVocabulary\n \n import six\n import transaction\ndiff --git a/src/plone/restapi/tests/test_setup.py b/src/plone/restapi/tests/test_setup.py\nindex 5357e39b..b163c978 100644\n--- a/src/plone/restapi/tests/test_setup.py\n+++ b/src/plone/restapi/tests/test_setup.py\n@@ -1,12 +1,12 @@\n # -*- coding: utf-8 -*-\n-import unittest\n-\n-from Products.CMFCore.utils import getToolByName\n-from plone.browserlayer.utils import registered_layers\n-\n from plone import api\n+from plone.browserlayer.utils import registered_layers\n from plone.restapi import PROJECT_NAME\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n+from Products.CMFCore.utils import getToolByName\n+\n+import unittest\n+\n \n try:\n from Products.CMFPlone.utils import get_installer\ndiff --git a/src/plone/restapi/tests/test_site_serializer.py b/src/plone/restapi/tests/test_site_serializer.py\nindex 8e7070a5..e941f1aa 100644\n--- a/src/plone/restapi/tests/test_site_serializer.py\n+++ b/src/plone/restapi/tests/test_site_serializer.py\n@@ -3,7 +3,6 @@\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n from zope.component import getMultiAdapter\n \n-\n import json\n import unittest\n \ndiff --git a/src/plone/restapi/tests/test_time_freezing.py b/src/plone/restapi/tests/test_time_freezing.py\nindex a35eff6c..0e28dd33 100644\n--- a/src/plone/restapi/tests/test_time_freezing.py\n+++ b/src/plone/restapi/tests/test_time_freezing.py\n@@ -1,19 +1,19 @@\n # -*- coding: utf-8 -*-\n from freezegun import freeze_time\n+\n import freezegun\n import time\n import unittest\n \n \n class TestTimeFreezing(unittest.TestCase):\n-\n def test_freezegun_provides_original_time_functions(self):\n """This test guards against future API changes in freezegun.\n """\n # These module globals in freezegun.api provide access to the\n # original time functions.\n- self.assertTrue(hasattr(freezegun.api, \'real_time\'))\n- self.assertTrue(hasattr(freezegun.api, \'real_gmtime\'))\n+ self.assertTrue(hasattr(freezegun.api, "real_time"))\n+ self.assertTrue(hasattr(freezegun.api, "real_gmtime"))\n \n # Before freezing time, they should be references to the\n # real time functions\ndiff --git a/src/plone/restapi/tests/test_tus.py b/src/plone/restapi/tests/test_tus.py\nindex 08aca316..ee63d46b 100644\n--- a/src/plone/restapi/tests/test_tus.py\n+++ b/src/plone/restapi/tests/test_tus.py\n@@ -32,6 +32,7 @@\n import transaction\n import unittest\n \n+\n UPLOAD_DATA = b"abcdefgh"\n UPLOAD_MIMETYPE = "text/plain"\n UPLOAD_FILENAME = "test.txt"\ndiff --git a/src/plone/restapi/tests/test_types.py b/src/plone/restapi/tests/test_types.py\nindex eed2f5ba..c790cc32 100644\n--- a/src/plone/restapi/tests/test_types.py\n+++ b/src/plone/restapi/tests/test_types.py\n@@ -203,20 +203,20 @@ def dummy_source_vocab(self, context):\n )\n \n def test_context_aware_default_factory(self):\n- folder = self.portal[self.portal.invokeFactory(\n- "Folder", id="folder", title="My Folder")]\n+ folder = self.portal[\n+ self.portal.invokeFactory("Folder", id="folder", title="My Folder")\n+ ]\n \n @provider(IContextAwareDefaultFactory)\n def uppercased_title_default(context):\n return context.title.upper()\n \n field = schema.TextLine(\n- title=u"My field", description=u"My great field",\n- defaultFactory=uppercased_title_default\n- )\n- adapter = getMultiAdapter(\n- (field, folder, self.request), IJsonSchemaProvider\n+ title=u"My field",\n+ description=u"My great field",\n+ defaultFactory=uppercased_title_default,\n )\n+ adapter = getMultiAdapter((field, folder, self.request), IJsonSchemaProvider)\n \n self.assertEqual(\n {\ndiff --git a/src/plone/restapi/tests/test_workflow.py b/src/plone/restapi/tests/test_workflow.py\nindex 85b9e278..dfe790a3 100644\n--- a/src/plone/restapi/tests/test_workflow.py\n+++ b/src/plone/restapi/tests/test_workflow.py\n@@ -1,20 +1,20 @@\n # -*- coding: utf-8 -*-\n-from DateTime import DateTime\n-from Products.CMFCore.utils import getToolByName\n-from ZPublisher.pubevents import PubStart\n from base64 import b64encode\n+from DateTime import DateTime\n+from plone.app.testing import login\n+from plone.app.testing import setRoles\n from plone.app.testing import SITE_OWNER_NAME\n from plone.app.testing import SITE_OWNER_PASSWORD\n from plone.app.testing import TEST_USER_ID\n from plone.app.testing import TEST_USER_NAME\n-from plone.app.testing import login\n-from plone.app.testing import setRoles\n from plone.restapi.interfaces import ISerializeToJson\n from plone.restapi.testing import PLONE_RESTAPI_DX_INTEGRATION_TESTING\n+from Products.CMFCore.utils import getToolByName\n from unittest import TestCase\n from zExceptions import NotFound\n from zope.component import getMultiAdapter\n from zope.event import notify\n+from ZPublisher.pubevents import PubStart\n \n \n class TestWorkflowInfo(TestCase):\n@@ -131,7 +131,7 @@ def test_transition_action_succeeds_changes_effective(self):\n doc1 = self.portal.doc1\n self.assertEqual(doc1.effective_date, None)\n now = DateTime()\n- service = self.traverse(\'/plone/doc1/@workflow/publish\')\n+ service = self.traverse("/plone/doc1/@workflow/publish")\n service.reply()\n self.assertTrue(isinstance(doc1.effective_date, DateTime))\n self.assertTrue(doc1.effective_date >= now)\ndiff --git a/src/plone/restapi/types/adapters.py b/src/plone/restapi/types/adapters.py\nindex 32281cd9..d715202b 100644\n--- a/src/plone/restapi/types/adapters.py\n+++ b/src/plone/restapi/types/adapters.py\n@@ -2,9 +2,10 @@\n """JsonSchema providers."""\n from plone.app.textfield.interfaces import IRichText\n from plone.restapi.types.interfaces import IJsonSchemaProvider\n-from plone.restapi.types.utils import get_fieldsets, get_widget_params\n+from plone.restapi.types.utils import get_fieldsets\n from plone.restapi.types.utils import get_jsonschema_properties\n from plone.restapi.types.utils import get_vocabulary_url\n+from plone.restapi.types.utils import get_widget_params\n from plone.schema import IJSONField\n from zope.component import adapter\n from zope.component import getMultiAdapter\ndiff --git a/src/plone/restapi/types/utils.py b/src/plone/restapi/types/utils.py\nindex 82e2e2dd..e46d5388 100644\n--- a/src/plone/restapi/types/utils.py\n+++ b/src/plone/restapi/types/utils.py\n@@ -21,8 +21,8 @@\n from plone.dexterity.utils import getAdditionalSchemata\n from plone.restapi.serializer.converters import IJsonCompatible\n from plone.restapi.types.interfaces import IJsonSchemaProvider\n-from Products.CMFCore.utils import getToolByName\n from plone.supermodel.utils import mergedTaggedValueDict\n+from Products.CMFCore.utils import getToolByName\n from z3c.form import form as z3c_form\n from zope.component import getMultiAdapter\n from zope.component import queryMultiAdapter\ndiff --git a/src/plone/restapi/types/z3crelationadapter.py b/src/plone/restapi/types/z3crelationadapter.py\nindex 4bba58eb..8a91755f 100644\n--- a/src/plone/restapi/types/z3crelationadapter.py\n+++ b/src/plone/restapi/types/z3crelationadapter.py\n@@ -1,4 +1,5 @@\n # -*- coding: utf-8 -*-\n+from plone.restapi.types.adapters import ListJsonSchemaProvider\n from plone.restapi.types.interfaces import IJsonSchemaProvider\n from z3c.relationfield.interfaces import IRelationList\n from zope.component import adapter\n@@ -6,8 +7,6 @@\n from zope.interface import implementer\n from zope.interface import Interface\n \n-from plone.restapi.types.adapters import ListJsonSchemaProvider\n-\n \n @adapter(IRelationList, Interface, Interface)\n @implementer(IJsonSchemaProvider)\n' +b'diff --git a/Products/CMFFormController/Actions/BaseFormAction.py b/Products/CMFFormController/Actions/BaseFormAction.py\nindex 3595fe7..00231be 100644\n--- a/Products/CMFFormController/Actions/BaseFormAction.py\n+++ b/Products/CMFFormController/Actions/BaseFormAction.py\n@@ -7,6 +7,7 @@\n from Products.CMFFormController.utils import log\n from Products.PageTemplates.Expressions import getEngine\n from Products.PageTemplates.Expressions import SecureModuleImporter\n+from six.moves.urllib.parse import parse_qs\n from six.moves.urllib.parse import urlparse\n from six.moves.urllib.parse import urlunparse\n from zope.interface import implementer\n@@ -89,14 +90,13 @@ def getArg(self, controller_state):\n def combineArgs(self, url, kwargs):\n """Utility method that takes a URL, parses its existing query string,\n and combines the resulting dict with kwargs"""\n- import cgi\n \n # parse the existing URL\n parsed_url = list(urlparse(url))\n # get the existing query string\n qs = parsed_url[4]\n # parse the query into a dict\n- d = cgi.parse_qs(qs, 1)\n+ d = parse_qs(qs, 1)\n # update with stuff from kwargs\n for k, v in kwargs.items():\n if isinstance(v, six.text_type):\ndiff --git a/news/20.feature b/news/20.feature\nnew file mode 100644\nindex 0000000..c0eea9e\n--- /dev/null\n+++ b/news/20.feature\n@@ -0,0 +1 @@\n+Add support for Python 3.8 [pbauer]\n\\ No newline at end of file\n'