From fd840237d4eb374c0d3f4ac2bb394aefaa43d40c Mon Sep 17 00:00:00 2001 From: John Anderson Date: Sat, 7 Feb 2015 17:33:39 -0800 Subject: Fix py32 support --- pyramid/tests/test_util.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pyramid/tests/test_util.py b/pyramid/tests/test_util.py index 405fe927a..371cd8703 100644 --- a/pyramid/tests/test_util.py +++ b/pyramid/tests/test_util.py @@ -1,9 +1,11 @@ import unittest from pyramid.compat import PY3 + class Test_InstancePropertyMixin(unittest.TestCase): def _makeOne(self): cls = self._getTargetClass() + class Foo(cls): pass return Foo() @@ -637,8 +639,14 @@ class TestActionInfo(unittest.TestCase): class TestCallableName(unittest.TestCase): def test_valid_ascii(self): from pyramid.util import get_callable_name - name = u'hello world' - self.assertEquals(get_callable_name(name), name) + from pyramid.compat import text_, PY3 + + if PY3: # pragma: nocover + name = b'hello world' + else: # pragma: nocover + name = text_(b'hello world', 'utf-8') + + self.assertEquals(get_callable_name(name), 'hello world') def test_invalid_ascii(self): from pyramid.util import get_callable_name -- cgit v1.2.3