diff options
| author | Bert JW Regeer <bertjw@regeer.org> | 2017-02-06 21:28:55 -0700 |
|---|---|---|
| committer | Bert JW Regeer <bertjw@regeer.org> | 2017-02-06 21:28:55 -0700 |
| commit | d95a421694ade78dbe332a7becb8fd492bd2a01c (patch) | |
| tree | b20915471bef5d8b2ab60c090780c098cc7eae1d | |
| parent | 39d89556229df54189abe5e327dc9f716563a4a6 (diff) | |
| download | pyramid-d95a421694ade78dbe332a7becb8fd492bd2a01c.tar.gz pyramid-d95a421694ade78dbe332a7becb8fd492bd2a01c.tar.bz2 pyramid-d95a421694ade78dbe332a7becb8fd492bd2a01c.zip | |
Test to verify that httpexc.detail may be non-str
| -rw-r--r-- | pyramid/tests/test_httpexceptions.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pyramid/tests/test_httpexceptions.py b/pyramid/tests/test_httpexceptions.py index 224fa4cf0..e2d463008 100644 --- a/pyramid/tests/test_httpexceptions.py +++ b/pyramid/tests/test_httpexceptions.py @@ -2,6 +2,7 @@ import unittest from pyramid.compat import ( bytes_, + string_types, text_, ) @@ -364,6 +365,11 @@ class TestHTTPException(unittest.TestCase): 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 |
