diff options
| author | Claude Paroz <claude@2xlibre.net> | 2014-07-12 19:37:59 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-08-19 22:29:31 +0200 |
| commit | fa02120d360387bebbbe735e86686bb4c7c43db2 (patch) | |
| tree | 7560f8734d1e832fda77b8e4b1450b10799b5a2f /tests/httpwrappers | |
| parent | 11d9cbe2f46583716aed4859f180a973bf2d5cf4 (diff) | |
Fixed #22996 -- Prevented crash with unencoded query string
Thanks Jorge Carleitao for the report and Aymeric Augustin, Tim Graham
for the reviews.
Diffstat (limited to 'tests/httpwrappers')
| -rw-r--r-- | tests/httpwrappers/tests.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py index 556d65a0a8..0be5df3024 100644 --- a/tests/httpwrappers/tests.py +++ b/tests/httpwrappers/tests.py @@ -203,14 +203,14 @@ class QueryDictTests(unittest.TestCase): def test_invalid_input_encoding(self): """ QueryDicts must be able to handle invalid input encoding (in this - case, bad UTF-8 encoding). + case, bad UTF-8 encoding), falling back to ISO-8859-1 decoding. This test doesn't apply under Python 3 because the URL is a string and not a bytestring. """ q = QueryDict(str(b'foo=bar&foo=\xff')) - self.assertEqual(q['foo'], '\ufffd') - self.assertEqual(q.getlist('foo'), ['bar', '\ufffd']) + self.assertEqual(q['foo'], '\xff') + self.assertEqual(q.getlist('foo'), ['bar', '\xff']) def test_pickle(self): q = QueryDict() |
