Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed an encoding issue in the test client.

Fixed
comment_tests.tests.test_comment_view.CommentViewTests.testCommentPostRedirectWithInvalidIntegerPK.

Refs #20530.
  • Loading branch information...
commit 7bb627936034c1b9500a8d250cce75b30f980b23 1 parent c54fa1a
Aymeric Augustin aaugustin authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 django/test/client.py
6 django/test/client.py
View
@@ -333,7 +333,11 @@ def generic(self, method, path,
r.update(extra)
# If QUERY_STRING is absent or empty, we want to extract it from the URL.
if not r.get('QUERY_STRING'):
- r['QUERY_STRING'] = force_str(parsed[4])
+ query_string = force_bytes(parsed[4])
+ # WSGI requires latin-1 encoded strings. See get_path_info().
+ if six.PY3:
+ query_string = query_string.decode('iso-8859-1')2053020530
+ r['QUERY_STRING'] = query_string
return self.request(**r)
Please sign in to comment.
Something went wrong with that request. Please try again.