summaryrefslogtreecommitdiff
path: root/tests/test_httpexceptions.py
diff options
context:
space:
mode:
authorMichael Merickel <github@m.merickel.org>2018-11-26 17:10:21 -0600
committerGitHub <noreply@github.com>2018-11-26 17:10:21 -0600
commit587fe72fae0efda3a860d37a1ea2449a41dab622 (patch)
treead938e23efd1be67821ddfb710748e746c92c420 /tests/test_httpexceptions.py
parenteea97ca673a53f8aa039a78e61833f78d5d59583 (diff)
parent81171e861d25d394c0ccb8a6139a9b89dc4f039c (diff)
downloadpyramid-587fe72fae0efda3a860d37a1ea2449a41dab622.tar.gz
pyramid-587fe72fae0efda3a860d37a1ea2449a41dab622.tar.bz2
pyramid-587fe72fae0efda3a860d37a1ea2449a41dab622.zip
Merge pull request #3421 from mmerickel/drop-py2
remove py2 from the codebase
Diffstat (limited to 'tests/test_httpexceptions.py')
-rw-r--r--tests/test_httpexceptions.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_httpexceptions.py b/tests/test_httpexceptions.py
index 4c13e096d..5decfc39c 100644
--- a/tests/test_httpexceptions.py
+++ b/tests/test_httpexceptions.py
@@ -1,6 +1,6 @@
import unittest
-from pyramid.compat import bytes_, string_types, text_
+from pyramid.util import bytes_, text_
class Test_exception_response(unittest.TestCase):
@@ -67,6 +67,12 @@ class Test__no_escape(unittest.TestCase):
def test_not_basestring(self):
self.assertEqual(self._callFUT(42), '42')
+ def test_bytes(self):
+ self.assertEqual(
+ self._callFUT(b'/La Pe\xc3\xb1a/{x}'),
+ b'/La Pe\xc3\xb1a/{x}'.decode('utf-8'),
+ )
+
def test_unicode(self):
class DummyUnicodeObject(object):
def __unicode__(self):
@@ -406,7 +412,7 @@ class TestHTTPException(unittest.TestCase):
def test_allow_detail_non_str(self):
exc = self._makeOne(detail={'error': 'This is a test'})
- self.assertIsInstance(exc.__str__(), string_types)
+ self.assertIsInstance(exc.__str__(), str)
class TestRenderAllExceptionsWithoutArguments(unittest.TestCase):