Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #9585 -- Corrected code committed in [9398] that wasn't compati…

…ble with Python 2.3/2.4. Thanks to Karen Tracey for the report and fix.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9465 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 98ec741a03221e2b2a4c465e04ddede0795185af 1 parent 21e86f2
@freakboy3742 freakboy3742 authored
Showing with 12 additions and 12 deletions.
  1. +12 −12 django/test/client.py
View
24 django/test/client.py
@@ -264,8 +264,8 @@ def get(self, path, data={}, **extra):
parsed = urlparse(path)
r = {
'CONTENT_TYPE': 'text/html; charset=utf-8',
- 'PATH_INFO': urllib.unquote(parsed.path),
- 'QUERY_STRING': urlencode(data, doseq=True) or parsed.query,
+ 'PATH_INFO': urllib.unquote(parsed[2]),
+ 'QUERY_STRING': urlencode(data, doseq=True) or parsed[4],
'REQUEST_METHOD': 'GET',
'wsgi.input': FakePayload('')
}
@@ -286,8 +286,8 @@ def post(self, path, data={}, content_type=MULTIPART_CONTENT, **extra):
r = {
'CONTENT_LENGTH': len(post_data),
'CONTENT_TYPE': content_type,
- 'PATH_INFO': urllib.unquote(parsed.path),
- 'QUERY_STRING': parsed.query,
+ 'PATH_INFO': urllib.unquote(parsed[2]),
+ 'QUERY_STRING': parsed[4],
'REQUEST_METHOD': 'POST',
'wsgi.input': FakePayload(post_data),
}
@@ -302,8 +302,8 @@ def head(self, path, data={}, **extra):
parsed = urlparse(path)
r = {
'CONTENT_TYPE': 'text/html; charset=utf-8',
- 'PATH_INFO': urllib.unquote(parsed.path),
- 'QUERY_STRING': urlencode(data, doseq=True) or parsed.query,
+ 'PATH_INFO': urllib.unquote(parsed[2]),
+ 'QUERY_STRING': urlencode(data, doseq=True) or parsed[4],
'REQUEST_METHOD': 'HEAD',
'wsgi.input': FakePayload('')
}
@@ -317,8 +317,8 @@ def options(self, path, data={}, **extra):
"""
parsed = urlparse(path)
r = {
- 'PATH_INFO': urllib.unquote(parsed.path),
- 'QUERY_STRING': urlencode(data, doseq=True) or parsed.query,
+ 'PATH_INFO': urllib.unquote(parsed[2]),
+ 'QUERY_STRING': urlencode(data, doseq=True) or parsed[4],
'REQUEST_METHOD': 'OPTIONS',
'wsgi.input': FakePayload('')
}
@@ -339,8 +339,8 @@ def put(self, path, data={}, content_type=MULTIPART_CONTENT, **extra):
r = {
'CONTENT_LENGTH': len(post_data),
'CONTENT_TYPE': content_type,
- 'PATH_INFO': urllib.unquote(parsed.path),
- 'QUERY_STRING': urlencode(data, doseq=True) or parsed.query,
+ 'PATH_INFO': urllib.unquote(parsed[2]),
+ 'QUERY_STRING': urlencode(data, doseq=True) or parsed[4],
'REQUEST_METHOD': 'PUT',
'wsgi.input': FakePayload(post_data),
}
@@ -354,8 +354,8 @@ def delete(self, path, data={}, **extra):
"""
parsed = urlparse(path)
r = {
- 'PATH_INFO': urllib.unquote(parsed.path),
- 'QUERY_STRING': urlencode(data, doseq=True) or parsed.query,
+ 'PATH_INFO': urllib.unquote(parsed[2]),
+ 'QUERY_STRING': urlencode(data, doseq=True) or parsed[4],
'REQUEST_METHOD': 'DELETE',
'wsgi.input': FakePayload('')
}
Please sign in to comment.
Something went wrong with that request. Please try again.