From d95a421694ade78dbe332a7becb8fd492bd2a01c Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Mon, 6 Feb 2017 21:28:55 -0700 Subject: Test to verify that httpexc.detail may be non-str --- pyramid/tests/test_httpexceptions.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3