diff options
| author | SaJH <wogur981208@gmail.com> | 2024-10-16 01:11:46 +0900 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-10-16 11:52:22 +0200 |
| commit | 0c8177551500e960d2dc04bc4b0fa7060f9172ae (patch) | |
| tree | 1453b4739431a2efeebd2d2db4f9141e1d064769 /tests/view_tests | |
| parent | 4a685bc0dca5298a7d5a4e162120a90cac7fd1a4 (diff) | |
Refs #35727 -- Updated response.content.decode calls to use the HttpResponse.text property.
Signed-off-by: SaJH <wogur981208@gmail.com>
Diffstat (limited to 'tests/view_tests')
| -rw-r--r-- | tests/view_tests/tests/test_i18n.py | 4 | ||||
| -rw-r--r-- | tests/view_tests/tests/test_json.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/view_tests/tests/test_i18n.py b/tests/view_tests/tests/test_i18n.py index 93e91bcc83..229ce68bfc 100644 --- a/tests/view_tests/tests/test_i18n.py +++ b/tests/view_tests/tests/test_i18n.py @@ -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) diff --git a/tests/view_tests/tests/test_json.py b/tests/view_tests/tests/test_json.py index 145e6e05a4..b314510f3c 100644 --- a/tests/view_tests/tests/test_json.py +++ b/tests/view_tests/tests/test_json.py @@ -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"}, |
