Skip to content

Commit

Permalink
Fixed deprecation warnings for zope.site.hooks and ILanguageSchema.
Browse files Browse the repository at this point in the history
Note: zope.component.hooks already works in Plone 4.3.
Part of #975
  • Loading branch information
mauritsvanrees committed Sep 2, 2020
1 parent 2dd5284 commit 727be21
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions news/975.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed deprecation warnings for ``zope.site.hooks`` and ``CMFPlone.interfaces.ILanguageSchema``.
[maurits]
7 changes: 6 additions & 1 deletion src/plone/restapi/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ def enable_request_language_negotiation(portal):
pieces of content in different languages.
"""
if PLONE_5:
from Products.CMFPlone.interfaces import ILanguageSchema
try:
# Plone 5.2+
from plone.i18n.interfaces import ILanguageSchema
except ImportError: # pragma: no cover
# Plone 5.0/5.1
from Products.CMFPlone.interfaces import ILanguageSchema

registry = getUtility(IRegistry)
settings = registry.forInterface(ILanguageSchema, prefix="plone")
Expand Down
2 changes: 1 addition & 1 deletion src/plone/restapi/tests/test_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from zope.component import createObject
from zope.component import getUtility
from zope.interface import alsoProvides
from zope.site.hooks import getSite
from zope.component.hooks import getSite

import collections
import json
Expand Down
2 changes: 1 addition & 1 deletion src/plone/restapi/tests/test_serializer_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from plone.restapi.testing import register_static_uuid_utility
from Products.CMFCore.utils import getToolByName
from zope.component import getMultiAdapter
from zope.site.hooks import getSite
from zope.component.hooks import getSite

import Missing
import unittest
Expand Down

0 comments on commit 727be21

Please sign in to comment.