Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored September 07, 2013

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  django/test/client.py
6  django/test/client.py
@@ -333,7 +333,11 @@ def generic(self, method, path,
333 333
         r.update(extra)
334 334
         # If QUERY_STRING is absent or empty, we want to extract it from the URL.
335 335
         if not r.get('QUERY_STRING'):
336  
-            r['QUERY_STRING'] = force_str(parsed[4])
  336
+            query_string = force_bytes(parsed[4])
  337
+            # WSGI requires latin-1 encoded strings. See get_path_info().
  338
+            if six.PY3:
  339
+                query_string = query_string.decode('iso-8859-1')2053020530
  340
+            r['QUERY_STRING'] = query_string
337 341
         return self.request(**r)
338 342
 
339 343
 

0 notes on commit 7bb6279

Please sign in to comment.
Something went wrong with that request. Please try again.