summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-09-24 05:34:47 -0400
committerChris McDonough <chrism@plope.com>2011-09-24 05:34:47 -0400
commit10aaa260624def9a41f3565830f2230f9bfde1ae (patch)
tree01e3ad600abe281cf2934f100c5acd0217da5a0e
parent0e131e30da1c5ce9c35965252a5718f1b2660eea (diff)
downloadpyramid-10aaa260624def9a41f3565830f2230f9bfde1ae.tar.gz
pyramid-10aaa260624def9a41f3565830f2230f9bfde1ae.tar.bz2
pyramid-10aaa260624def9a41f3565830f2230f9bfde1ae.zip
fix test_config/test_views on py3
-rw-r--r--pyramid/config/views.py2
-rw-r--r--pyramid/tests/test_config/test_views.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/pyramid/config/views.py b/pyramid/config/views.py
index 326aa801e..726223fd9 100644
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -1064,7 +1064,7 @@ class ViewsConfiguratorMixin(object):
'view', context, name, request_type, IView, containment,
request_param, request_method, route_name, attr,
xhr, accept, header, path_info, match_param]
- discriminator.extend(sorted(custom_predicates))
+ discriminator.extend(sorted([hash(x) for x in custom_predicates]))
discriminator = tuple(discriminator)
self.action(discriminator, register)
diff --git a/pyramid/tests/test_config/test_views.py b/pyramid/tests/test_config/test_views.py
index 9f2ff9b6f..ce8d01f38 100644
--- a/pyramid/tests/test_config/test_views.py
+++ b/pyramid/tests/test_config/test_views.py
@@ -353,7 +353,7 @@ class TestViewsConfigurationMixin(unittest.TestCase):
from pyramid.interfaces import IViewClassifier
from pyramid.interfaces import IMultiView
phash = md5()
- phash.update('xhr:True')
+ phash.update(b'xhr:True')
view = lambda *arg: 'NOT OK'
view.__phash__ = phash.hexdigest()
config = self._makeOne(autocommit=True)
@@ -377,7 +377,7 @@ class TestViewsConfigurationMixin(unittest.TestCase):
from pyramid.interfaces import IExceptionViewClassifier
from pyramid.interfaces import IMultiView
phash = md5()
- phash.update('xhr:True')
+ phash.update(b'xhr:True')
view = lambda *arg: 'NOT OK'
view.__phash__ = phash.hexdigest()
config = self._makeOne(autocommit=True)
@@ -2656,7 +2656,7 @@ class TestViewDeriver(unittest.TestCase):
self.assertEqual(request.wrapped_body, inner_response.body)
self.assertEqual(request.wrapped_view.__original_view__,
inner_view)
- return Response('outer ' + request.wrapped_body)
+ return Response(b'outer ' + request.wrapped_body)
self.config.registry.registerAdapter(
outer_view, (IViewClassifier, None, None), IView, 'owrap')
deriver = self._makeOne(viewname='inner',