diff options
author | Claude Paroz <claude@2xlibre.net> | 2017-03-07 16:29:45 +0100 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2017-03-07 16:33:16 +0100 |
commit | 77c3cbe08a3bc8845a705519929f77237cb4d5d6 (patch) | |
tree | e65adb1557f8f56f8894d5a67040f9c766a72226 /tests/test_client_regress | |
parent | 4852276aba4e49cceeb6b15be56d80506da2e651 (diff) | |
download | django-77c3cbe08a3bc8845a705519929f77237cb4d5d6.tar.gz |
[1.11.x] Renamed a test variable to prevent possible conflict with imports
Backport of 324c4b6371cf635effd4d5ee7315c7311fbaf1b6 from master.
Diffstat (limited to 'tests/test_client_regress')
-rw-r--r-- | tests/test_client_regress/tests.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/test_client_regress/tests.py b/tests/test_client_regress/tests.py index 1e30017d5a..c21fd8651f 100644 --- a/tests/test_client_regress/tests.py +++ b/tests/test_client_regress/tests.py @@ -1286,30 +1286,30 @@ class UnicodePayloadTests(SimpleTestCase): def test_simple_unicode_payload(self): "A simple ASCII-only unicode JSON document can be POSTed" # Regression test for #10571 - json = '{"english": "mountain pass"}' - response = self.client.post("/parse_unicode_json/", json, content_type="application/json") - self.assertEqual(response.content, json.encode()) + json_str = '{"english": "mountain pass"}' + response = self.client.post("/parse_unicode_json/", json_str, content_type="application/json") + self.assertEqual(response.content, json_str.encode()) def test_unicode_payload_utf8(self): "A non-ASCII unicode data encoded as UTF-8 can be POSTed" # Regression test for #10571 - json = '{"dog": "собака"}' - response = self.client.post("/parse_unicode_json/", json, content_type="application/json; charset=utf-8") - self.assertEqual(response.content, json.encode('utf-8')) + json_str = '{"dog": "собака"}' + response = self.client.post("/parse_unicode_json/", json_str, content_type="application/json; charset=utf-8") + self.assertEqual(response.content, json_str.encode('utf-8')) def test_unicode_payload_utf16(self): "A non-ASCII unicode data encoded as UTF-16 can be POSTed" # Regression test for #10571 - json = '{"dog": "собака"}' - response = self.client.post("/parse_unicode_json/", json, content_type="application/json; charset=utf-16") - self.assertEqual(response.content, json.encode('utf-16')) + json_str = '{"dog": "собака"}' + response = self.client.post("/parse_unicode_json/", json_str, content_type="application/json; charset=utf-16") + self.assertEqual(response.content, json_str.encode('utf-16')) def test_unicode_payload_non_utf(self): "A non-ASCII unicode data as a non-UTF based encoding can be POSTed" # Regression test for #10571 - json = '{"dog": "собака"}' - response = self.client.post("/parse_unicode_json/", json, content_type="application/json; charset=koi8-r") - self.assertEqual(response.content, json.encode('koi8-r')) + json_str = '{"dog": "собака"}' + response = self.client.post("/parse_unicode_json/", json_str, content_type="application/json; charset=koi8-r") + self.assertEqual(response.content, json_str.encode('koi8-r')) class DummyFile(object): |