diff options
| author | Chris McDonough <chrism@plope.com> | 2011-09-24 06:09:56 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-09-24 06:09:56 -0400 |
| commit | 0ce501a771feaed09d19ebf45ba514648d7f819b (patch) | |
| tree | afe808abbbc7089c776968e913c6f5afb8f0eb2e | |
| parent | fbd01aca7c6d9ee97a35070398c85192dec3b2af (diff) | |
| download | pyramid-0ce501a771feaed09d19ebf45ba514648d7f819b.tar.gz pyramid-0ce501a771feaed09d19ebf45ba514648d7f819b.tar.bz2 pyramid-0ce501a771feaed09d19ebf45ba514648d7f819b.zip | |
fix adapter tests for py3
| -rw-r--r-- | pyramid/tests/test_config/test_adapters.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pyramid/tests/test_config/test_adapters.py b/pyramid/tests/test_config/test_adapters.py index ff1ce52a1..84b7119cf 100644 --- a/pyramid/tests/test_config/test_adapters.py +++ b/pyramid/tests/test_config/test_adapters.py @@ -1,5 +1,6 @@ import unittest +from pyramid.compat import PY3 from pyramid.tests.test_config import IDummy class AdaptersConfiguratorMixinTests(unittest.TestCase): @@ -103,8 +104,11 @@ class AdaptersConfiguratorMixinTests(unittest.TestCase): def test_add_response_adapter_dottednames(self): from pyramid.interfaces import IResponse config = self._makeOne(autocommit=True) - config.add_response_adapter('pyramid.response.Response', - 'types.StringType') + if PY3: # pragma: no cover + str_name = 'builtins.str' + else: + str_name = '__builtin__.str' + config.add_response_adapter('pyramid.response.Response', str_name) result = config.registry.queryAdapter('foo', IResponse) - self.assertTrue(result.body, 'foo') + self.assertTrue(result.body, b'foo') |
