0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Fixed #9585 -- Corrected code committed in [9398] that wasn't compatible 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
This commit is contained in:
Russell Keith-Magee 2008-11-16 08:20:25 +00:00
parent 21e86f2af2
commit 98ec741a03

View File

@ -264,8 +264,8 @@ class Client(object):
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 @@ class Client(object):
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 @@ class Client(object):
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 @@ class Client(object):
"""
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 @@ class Client(object):
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 @@ class Client(object):
"""
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('')
}