1
0
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:
SaJH
2024-10-16 01:11:46 +09:00
committed by Sarah Boyce
parent 4a685bc0dc
commit 0c81775515
12 changed files with 63 additions and 65 deletions

View File

@@ -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)

View File

@@ -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"},