mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #35727 -- Updated response.content.decode calls to use the HttpResponse.text property.
Signed-off-by: SaJH <wogur981208@gmail.com>
This commit is contained in:
@@ -295,7 +295,7 @@ class I18NViewTests(SimpleTestCase):
|
||||
"""
|
||||
with override("de"):
|
||||
response = self.client.get("/jsoni18n/")
|
||||
data = json.loads(response.content.decode())
|
||||
data = json.loads(response.text)
|
||||
self.assertIn("catalog", data)
|
||||
self.assertIn("formats", data)
|
||||
self.assertEqual(
|
||||
@@ -329,7 +329,7 @@ class I18NViewTests(SimpleTestCase):
|
||||
"""
|
||||
with self.settings(LANGUAGE_CODE="es"), override("en-us"):
|
||||
response = self.client.get("/jsoni18n/")
|
||||
data = json.loads(response.content.decode())
|
||||
data = json.loads(response.text)
|
||||
self.assertIn("catalog", data)
|
||||
self.assertIn("formats", data)
|
||||
self.assertIn("plural", data)
|
||||
|
||||
@@ -10,7 +10,7 @@ class JsonResponseTests(SimpleTestCase):
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.headers["content-type"], "application/json")
|
||||
self.assertEqual(
|
||||
json.loads(response.content.decode()),
|
||||
json.loads(response.text),
|
||||
{
|
||||
"a": [1, 2, 3],
|
||||
"foo": {"bar": "baz"},
|
||||
|
||||
Reference in New Issue
Block a user