Skip to content

Commit

Permalink
Merge pull request #23 from fschulze/pyramid18
Browse files Browse the repository at this point in the history
Fix compatibility with Pyramid 1.8
  • Loading branch information
fschulze committed Apr 3, 2017
2 parents 5d162f1 + 7357d01 commit af63486
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
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

0 comments on commit af63486

Please sign in to comment.