Permalink
Browse files

- Compatible with only Pyramid 1.2dev+ (uses e.g. set_authentication_…

…policy

  rather than _set_authentication_policy).
  • Loading branch information...
1 parent 4f927db commit 5ffddf264b64a8a04824dfe991c132028e4eb12e @mcdonc mcdonc committed Aug 16, 2011
Showing with 19 additions and 28 deletions.
  1. +1 −1 .gitignore
  2. +3 −0 CHANGES.txt
  3. +12 −10 pyramid_zcml/__init__.py
  4. +0 −14 pyramid_zcml/tests/test_units.py
  5. +1 −1 setup.py
  6. +2 −2 tox.ini
View
@@ -7,4 +7,4 @@ dist/
.tox/
nosetests.xml
pyramid_zcml/coverage.xml
-
+*$py.class
View
@@ -3,6 +3,9 @@ Next release
- Fix a unit test failure when used with Venusian 0.9.
+- Compatible with only Pyramid 1.2dev+ (uses e.g. set_authentication_policy
+ rather than _set_authentication_policy).
+
0.3 (2011-07-22)
----------------
View
@@ -281,6 +281,14 @@ def route(_context,
raise ConfigurationError('route directive must include a "pattern"')
config = Configurator.with_context(_context)
+ if view:
+ config.add_view(
+ route_name=name,
+ view=view,
+ permission=view_permission,
+ context=view_context,
+ renderer=view_renderer,
+ attr=view_attr)
config.add_route(
name,
pattern,
@@ -292,15 +300,9 @@ def route(_context,
request_method=request_method,
request_param=request_param,
custom_predicates=custom_predicates,
- view=view,
- view_context=view_context,
- view_permission=view_permission,
- view_renderer=view_renderer,
- view_attr=view_attr,
use_global_views=use_global_views,
traverse=traverse,
)
-
class ISystemViewDirective(Interface):
view = GlobalObject(
@@ -376,7 +378,7 @@ def repozewho1authenticationpolicy(_context, identifier_name='auth_tkt',
# authentication policies must be registered eagerly so they can
# be found by the view registration machinery
config = Configurator.with_context(_context)
- config._set_authentication_policy(policy)
+ config.set_authentication_policy(policy)
class IRemoteUserAuthenticationPolicyDirective(Interface):
environ_key = TextLine(title=u'environ_key', required=False,
@@ -390,7 +392,7 @@ def remoteuserauthenticationpolicy(_context, environ_key='REMOTE_USER',
# authentication policies must be registered eagerly so they can
# be found by the view registration machinery
config = Configurator.with_context(_context)
- config._set_authentication_policy(policy)
+ config.set_authentication_policy(policy)
class IAuthTktAuthenticationPolicyDirective(Interface):
secret = TextLine(title=u'secret', required=True)
@@ -435,7 +437,7 @@ def authtktauthenticationpolicy(_context,
# authentication policies must be registered eagerly so they can
# be found by the view registration machinery
config = Configurator.with_context(_context)
- config._set_authentication_policy(policy)
+ config.set_authentication_policy(policy)
class IACLAuthorizationPolicyDirective(Interface):
pass
@@ -445,7 +447,7 @@ def aclauthorizationpolicy(_context):
# authorization policies must be registered eagerly so they can be
# found by the view registration machinery
config = Configurator.with_context(_context)
- config._set_authorization_policy(policy)
+ config.set_authorization_policy(policy)
class IRendererDirective(Interface):
factory = GlobalObject(
@@ -283,8 +283,6 @@ def test_it_defaults(self):
self.assertEqual(len(actions), 1)
regadapt = actions[0]
self.assertEqual(regadapt['discriminator'], IAuthenticationPolicy)
- self.assertEqual(regadapt['callable'], None)
- self.assertEqual(regadapt['args'], ())
policy = reg.getUtility(IAuthenticationPolicy)
self.assertEqual(policy.callback, None)
self.assertEqual(policy.identifier_name, 'auth_tkt')
@@ -300,8 +298,6 @@ def callback(identity, request):
self.assertEqual(len(actions), 1)
regadapt = actions[0]
self.assertEqual(regadapt['discriminator'], IAuthenticationPolicy)
- self.assertEqual(regadapt['callable'], None)
- self.assertEqual(regadapt['args'], ())
policy = reg.getUtility(IAuthenticationPolicy)
self.assertEqual(policy.callback, callback)
self.assertEqual(policy.identifier_name, 'something')
@@ -329,8 +325,6 @@ def callback(identity, request):
self.assertEqual(len(actions), 1)
regadapt = actions[0]
self.assertEqual(regadapt['discriminator'], IAuthenticationPolicy)
- self.assertEqual(regadapt['callable'], None)
- self.assertEqual(regadapt['args'], ())
policy = reg.getUtility(IAuthenticationPolicy)
self.assertEqual(policy.environ_key, 'REMOTE_USER')
self.assertEqual(policy.callback, None)
@@ -346,8 +340,6 @@ def callback(identity, request):
self.assertEqual(len(actions), 1)
regadapt = actions[0]
self.assertEqual(regadapt['discriminator'], IAuthenticationPolicy)
- self.assertEqual(regadapt['callable'], None)
- self.assertEqual(regadapt['args'], ())
policy = reg.getUtility(IAuthenticationPolicy)
self.assertEqual(policy.environ_key, 'BLAH')
self.assertEqual(policy.callback, callback)
@@ -373,8 +365,6 @@ def test_it_defaults(self):
self.assertEqual(len(actions), 1)
regadapt = actions[0]
self.assertEqual(regadapt['discriminator'], IAuthenticationPolicy)
- self.assertEqual(regadapt['callable'], None)
- self.assertEqual(regadapt['args'], ())
policy = reg.getUtility(IAuthenticationPolicy)
self.assertEqual(policy.cookie.secret, 'sosecret')
self.assertEqual(policy.callback, None)
@@ -393,8 +383,6 @@ def callback(identity, request):
self.assertEqual(len(actions), 1)
regadapt = actions[0]
self.assertEqual(regadapt['discriminator'], IAuthenticationPolicy)
- self.assertEqual(regadapt['callable'], None)
- self.assertEqual(regadapt['args'], ())
policy = reg.getUtility(IAuthenticationPolicy)
self.assertEqual(policy.cookie.path, '/sub/')
self.assertEqual(policy.cookie.http_only, True)
@@ -426,8 +414,6 @@ def callback(identity, request):
self.assertEqual(len(actions), 1)
regadapt = actions[0]
self.assertEqual(regadapt['discriminator'], IAuthorizationPolicy)
- self.assertEqual(regadapt['callable'], None)
- self.assertEqual(regadapt['args'], ())
policy = reg.getUtility(IAuthorizationPolicy)
self.assertEqual(policy.__class__, ACLAuthorizationPolicy)
View
@@ -25,7 +25,7 @@
README = CHANGES = ''
install_requires=[
- 'pyramid>=1.0b1', # autktauthenticationpolicy wild_domain
+ 'pyramid>=1.2dev', # set_auth{entication|orization}_policy
]
if platform.system() == 'Java':
View
@@ -10,7 +10,7 @@ deps =
WebTest
repoze.sphinx.autointerface
virtualenv
- pyramid
+ http://static.repoze.org/pyramid_trunk/pyramid-1.2dev.tar.gz # temporary
[testenv:jython]
commands =
@@ -26,10 +26,10 @@ deps =
WebTest
repoze.sphinx.autointerface
virtualenv
- pyramid
nose
coverage==3.4
nosexcover
+ http://static.repoze.org/pyramid_trunk/pyramid-1.2dev.tar.gz # temporary
# we separate coverage into its own testenv because a) "last run wins" wrt
# cobertura jenkins reporting and b) pypy and jython can't handle any

0 comments on commit 5ffddf2

Please sign in to comment.