X-Git-Url: https://code.kerkeslager.com/?p=fwx;a=blobdiff_plain;f=src%2Ftest_fwx.py;h=0887039cc04291243ab3c4076c63322a32e94835;hp=97a7f74a5b7788742fb6f445b5f505b7d5796583;hb=2e9a0dbf5bd8fb60f19bf2665fb4020a79320090;hpb=7b02629c8e924154857f35cef1364bef66fe3b75 diff --git a/src/test_fwx.py b/src/test_fwx.py index 97a7f74..0887039 100644 --- a/src/test_fwx.py +++ b/src/test_fwx.py @@ -41,14 +41,14 @@ class ResponseTests(unittest.TestCase): def test_headers(self): response = fwx.Response( - content_type='text/plain', + content_type='text/plain; charset=utf-8', content='Hello, world\n', ) self.assertEqual( response.headers, ( - ('Content-Type', 'text/plain'), + ('Content-Type', 'text/plain; charset=utf-8'), ('X-Content-Type-Options', 'nosniff'), ), ) @@ -56,12 +56,12 @@ class ResponseTests(unittest.TestCase): class HTMLResponseTests(unittest.TestCase): def test_sets_content_type(self): response = fwx.HTMLResponse('Hello, world') - self.assertEqual(response.content_type, 'text/html') + self.assertEqual(response.content_type, 'text/html; charset=utf-8') class JSONResponseTests(unittest.TestCase): def test_sets_content_type(self): response = fwx.JSONResponse({ 'foo': 'bar', 'baz': 42 }) - self.assertEqual(response.content_type, 'application/json') + self.assertEqual(response.content_type, 'application/json; charset=utf-8') def test_sets_content(self): response = fwx.JSONResponse({ 'foo': 'bar', 'baz': 42 }) @@ -74,7 +74,7 @@ class JSONResponseTests(unittest.TestCase): class TextResponseTests(unittest.TestCase): def test_sets_content_type(self): response = fwx.TextResponse('Hello, world\n') - self.assertEqual(response.content_type, 'text/plain') + self.assertEqual(response.content_type, 'text/plain; charset=utf-8') class RedirectResponse(unittest.TestCase): def test_takes_location_as_positional_argument(self):