diff --git a/django/http/__init__.py b/django/http/__init__.py
index ecb3912..3a9c57d 100644
a
|
b
|
class QueryDict(MultiValueDict):
|
392 | 392 | encoding=encoding): |
393 | 393 | self.appendlist(key, value) |
394 | 394 | else: |
395 | | for key, value in parse_qsl(query_string or '', |
| 395 | for key, value in parse_qsl(force_bytes(query_string) if query_string else '', |
396 | 396 | keep_blank_values=True): |
397 | 397 | self.appendlist(force_text(key, encoding, errors='replace'), |
398 | 398 | force_text(value, encoding, errors='replace')) |
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py
index 4c6aed1..93f82ba 100644
a
|
b
|
class QueryDictTests(unittest.TestCase):
|
95 | 95 | self.assertEqual(q.urlencode(), 'next=%2Ft%C3%ABst%26key%2F') |
96 | 96 | self.assertEqual(q.urlencode(safe='/'), 'next=/t%C3%ABst%26key/') |
97 | 97 | |
| 98 | def test_querystring_decode(self): |
| 99 | q = QueryDict(str('q=%D1%82%D0%B5%D1%81%D1%82')) |
| 100 | self.assertEqual(q['q'], "тест") |
| 101 | # With Python 2, unicode query string should also be properly decoded (#19075) |
| 102 | q = QueryDict('q=%D1%82%D0%B5%D1%81%D1%82') |
| 103 | self.assertEqual(q['q'], "тест") |
| 104 | |
98 | 105 | def test_mutable_copy(self): |
99 | 106 | """A copy of a QueryDict is mutable.""" |
100 | 107 | q = QueryDict(str('')).copy() |