From 62dbd4554223e4980730c1fb459f5aaf8f946608 Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Thu, 5 Apr 2018 17:44:08 -0600 Subject: Add failing test for MIMEAccept in httpexceptions --- pyramid/tests/test_httpexceptions.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyramid/tests/test_httpexceptions.py b/pyramid/tests/test_httpexceptions.py index e2d463008..ed6c41e0e 100644 --- a/pyramid/tests/test_httpexceptions.py +++ b/pyramid/tests/test_httpexceptions.py @@ -283,6 +283,17 @@ class TestHTTPException(unittest.TestCase): if header[0] == 'Content-Type': self.assertEqual(header[1], 'application/json') + def test__content_type_invalid(self): + cls = self._getTargetSubclass() + exc = cls() + environ = _makeEnviron() + environ['HTTP_ACCEPT'] = 'invalid' + start_response = DummyStartResponse() + exc(environ, start_response) + for header in start_response.headerlist: + if header[0] == 'Content-Type': + self.assertEqual(header[1], 'text/html; charset=UTF-8') + def test__default_app_iter_with_comment_ampersand(self): cls = self._getTargetSubclass() exc = cls(comment='comment & comment') -- cgit v1.2.3