diff options
| author | John Anderson <sontek@gmail.com> | 2015-02-07 17:33:39 -0800 |
|---|---|---|
| committer | John Anderson <sontek@gmail.com> | 2015-02-07 17:33:39 -0800 |
| commit | fd840237d4eb374c0d3f4ac2bb394aefaa43d40c (patch) | |
| tree | 6e42cb3a7bc4849c60db303d2c55731f7da899f2 | |
| parent | 4a86b211fe7d294d2c598b42bc80e0c150a08443 (diff) | |
| download | pyramid-fd840237d4eb374c0d3f4ac2bb394aefaa43d40c.tar.gz pyramid-fd840237d4eb374c0d3f4ac2bb394aefaa43d40c.tar.bz2 pyramid-fd840237d4eb374c0d3f4ac2bb394aefaa43d40c.zip | |
Fix py32 support
| -rw-r--r-- | pyramid/tests/test_util.py | 12 |
1 files 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 |
