Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with Pyramid 1.8 #23

Merged
merged 2 commits into from
Apr 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
- Add ``pyramid_mako`` testing dependency and configure it in tests
(Current versions of Pyramid split out ``Mako`` integration).

- Fix compatibility with Pyramid 1.8.

1.0.0 (2013-02-28)
------------------

Expand Down
4 changes: 2 additions & 2 deletions pyramid_zcml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.config import Configurator
from pyramid.exceptions import ConfigurationError
from pyramid.asset import asset_spec_from_abspath
from pyramid.asset import asset_spec_from_abspath, resolve_asset_spec
from pyramid.threadlocal import get_current_registry

from zope.configuration import xmlconfig
Expand Down Expand Up @@ -825,7 +825,7 @@ def load_zcml(self, spec='configure.zcml', lock=threading.Lock(), features=()):
The ``features`` argument can be any iterable of strings. These are useful
for conditionally including or excluding parts of a :term:`ZCML` file.
"""
package_name, filename = self._split_spec(spec)
package_name, filename = resolve_asset_spec(spec, self.package_name)
if package_name is None: # absolute filename
package = self.package
else:
Expand Down
16 changes: 8 additions & 8 deletions pyramid_zcml/tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_it(self):
from zope.interface import implementedBy
from pyramid.interfaces import IRequest
from pyramid.interfaces import IView
from pyramid.interfaces import IViewClassifier
from pyramid.interfaces import IExceptionViewClassifier
from pyramid.exceptions import NotFound
from pyramid.registry import undefer

Expand All @@ -147,7 +147,7 @@ def view(request):
register = actions[0]['callable']
register()
derived_view = reg.adapters.lookup(
(IViewClassifier, IRequest, implementedBy(NotFound)),
(IExceptionViewClassifier, IRequest, implementedBy(NotFound)),
IView, default=None)

self.assertNotEqual(derived_view, None)
Expand All @@ -158,7 +158,7 @@ def test_it_with_dotted_renderer(self):
from zope.interface import implementedBy
from pyramid.interfaces import IRequest
from pyramid.interfaces import IView
from pyramid.interfaces import IViewClassifier
from pyramid.interfaces import IExceptionViewClassifier
from pyramid.exceptions import NotFound
from pyramid.config import Configurator
from pyramid.registry import undefer
Expand All @@ -179,7 +179,7 @@ def view(request):
register = regadapt['callable']
register()
derived_view = reg.adapters.lookup(
(IViewClassifier, IRequest, implementedBy(NotFound)),
(IExceptionViewClassifier, IRequest, implementedBy(NotFound)),
IView, default=None)
self.assertNotEqual(derived_view, None)
self.assertEqual(derived_view(None, None).body, b('OK'))
Expand All @@ -200,7 +200,7 @@ def test_it(self):
from zope.interface import implementedBy
from pyramid.interfaces import IRequest
from pyramid.interfaces import IView
from pyramid.interfaces import IViewClassifier
from pyramid.interfaces import IExceptionViewClassifier
from pyramid.exceptions import Forbidden
from pyramid.registry import undefer
reg = self.config.registry
Expand All @@ -217,7 +217,7 @@ def view(request):
register = actions[0]['callable']
register()
derived_view = reg.adapters.lookup(
(IViewClassifier, IRequest, implementedBy(Forbidden)),
(IExceptionViewClassifier, IRequest, implementedBy(Forbidden)),
IView, default=None)

self.assertNotEqual(derived_view, None)
Expand All @@ -228,7 +228,7 @@ def test_it_with_dotted_renderer(self):
from zope.interface import implementedBy
from pyramid.interfaces import IRequest
from pyramid.interfaces import IView
from pyramid.interfaces import IViewClassifier
from pyramid.interfaces import IExceptionViewClassifier
from pyramid.exceptions import Forbidden
from pyramid.config import Configurator
from pyramid.registry import undefer
Expand All @@ -249,7 +249,7 @@ def view(request):
register = regadapt['callable']
register()
derived_view = reg.adapters.lookup(
(IViewClassifier, IRequest, implementedBy(Forbidden)),
(IExceptionViewClassifier, IRequest, implementedBy(Forbidden)),
IView, default=None)
self.assertNotEqual(derived_view, None)
self.assertEqual(derived_view(None, None).body, b('OK'))
Expand Down