Bert JW Regeer
2017-02-07 e35805b8adefb3ca6bfe05e5d1ece770ab916caf
Test to verify that httpexc.detail may be non-str
1 files modified
6 ■■■■■ changed files
pyramid/tests/test_httpexceptions.py 6 ●●●●● patch | view | raw | blame | history
pyramid/tests/test_httpexceptions.py
@@ -2,6 +2,7 @@
from pyramid.compat import (
    bytes_,
    string_types,
    text_,
    )
@@ -364,6 +365,11 @@
        body = list(exc(environ, start_response))[0]
        self.assertEqual(body, b'200 OK\n\n/La Pe\xc3\xb1a')
    def test_allow_detail_non_str(self):
        exc = self._makeOne(detail={'error': 'This is a test'})
        self.assertIsInstance(exc.__str__(), string_types)
class TestRenderAllExceptionsWithoutArguments(unittest.TestCase):
    def _doit(self, content_type):
        from pyramid.httpexceptions import status_map