diff options
| author | Bert JW Regeer <bertjw@regeer.org> | 2016-09-29 22:52:06 -0600 |
|---|---|---|
| committer | Bert JW Regeer <bertjw@regeer.org> | 2016-09-30 22:00:36 -0600 |
| commit | d3fa5925810a6fe628430d1b3a80191385257d58 (patch) | |
| tree | fe945733de6f367ed8cb7b593a377c72301e3479 /tests | |
| parent | 35fd5854b4b706adafa4caab43b6bcdcf3e6a934 (diff) | |
| download | webob-d3fa5925810a6fe628430d1b3a80191385257d58.tar.gz | |
Cleanup tests for Response.__init__
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_response.py | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/tests/test_response.py b/tests/test_response.py index 867d433..27e9e77 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -18,7 +18,7 @@ def teardown_module(module): def simple_app(environ, start_response): start_response('200 OK', [ - ('Content-Type', 'text/html; charset=utf8'), + ('Content-Type', 'text/html; charset=UTF-8'), ]) return ['OK'] @@ -28,7 +28,7 @@ def test_response(): assert res.status == '200 OK' assert res.status_code == 200 assert res.body == "OK" - assert res.charset == 'utf8' + assert res.charset == "UTF-8" assert res.content_type == 'text/html' res.status = 404 assert res.status == '404 Not Found' @@ -158,7 +158,7 @@ def test_cookies(): r2 = res.merge_cookies(simple_app) r2 = BaseRequest.blank('/').get_response(r2) assert r2.headerlist == [ - ('Content-Type', 'text/html; charset=utf8'), + ('Content-Type', 'text/html; charset=UTF-8'), ('Set-Cookie', 'x=test; Path=/'), ] @@ -476,19 +476,6 @@ def test_has_body(): messing_with_privates._app_iter = None assert not messing_with_privates.has_body -def test_content_type_in_headerlist(): - # Couldn't manage to clone Response in order to modify class - # attributes safely. Shouldn't classes be fresh imported for every - # test? - default_content_type = Response.default_content_type - Response.default_content_type = None - try: - res = Response(headerlist=[('Content-Type', 'text/html')], charset='utf8') - assert res._headerlist - assert res.charset == 'utf8' - finally: - Response.default_content_type = default_content_type - def test_str_crlf(): res = Response('test') assert '\r\n' in str(res) |
