summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testtools/content_type.py3
-rw-r--r--testtools/tests/test_content_type.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/testtools/content_type.py b/testtools/content_type.py
index c37e385..a08ef31 100644
--- a/testtools/content_type.py
+++ b/testtools/content_type.py
@@ -42,6 +42,7 @@ class ContentType(object):
return self.type == 'text' or self._text_override
-JSON = ContentType('application', 'json', text_override=True)
+JSON = ContentType(
+ 'application', 'json', {'charset': 'utf8'}, text_override=True)
UTF8_TEXT = ContentType('text', 'plain', {'charset': 'utf8'})
diff --git a/testtools/tests/test_content_type.py b/testtools/tests/test_content_type.py
index df149c9..f81718b 100644
--- a/testtools/tests/test_content_type.py
+++ b/testtools/tests/test_content_type.py
@@ -64,7 +64,7 @@ class TestBuiltinContentTypes(TestCase):
# The JSON content type represents implictly UTF-8 application/json.
self.assertThat(JSON.type, Equals('application'))
self.assertThat(JSON.subtype, Equals('json'))
- self.assertThat(JSON.parameters, Equals({}))
+ self.assertThat(JSON.parameters, Equals({'charset': 'utf8'}))
self.assertThat(JSON.is_text(), Equals(True))