summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2011-10-18 16:42:32 +0000
committerAymeric Augustin <aymeric.augustin@m4x.org>2011-10-18 16:42:32 +0000
commit14d24eb438c9930ff76302f263d0f2a8b42d13c1 (patch)
tree0685e3939c32c047650a6a248fdf174eb802e93f /django
parent396fcaaef92b6e5e56175b883c2cf6fcbda7ae97 (diff)
Fixed #17067 -- reverted some backwards-incompatible changes from r16933 and added tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17010 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/test/client.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/django/test/client.py b/django/test/client.py
index a5ef075f3c..30ef746f6c 100644
--- a/django/test/client.py
+++ b/django/test/client.py
@@ -182,12 +182,16 @@ class RequestFactory(object):
"""
The base environment for a request.
"""
- # This is a minimal valid WSGI environ dictionary, plus HTTP_COOKIE
- # for cookie support. Empty strings are omitted.
+ # This is a minimal valid WSGI environ dictionary, plus:
+ # - HTTP_COOKIE: for cookie support,
+ # - REMOTE_ADDR: often useful, see #8551.
# See http://www.python.org/dev/peps/pep-3333/#environ-variables
environ = {
'HTTP_COOKIE': self.cookies.output(header='', sep='; '),
+ 'PATH_INFO': '/',
+ 'REMOTE_ADDR': '127.0.0.1',
'REQUEST_METHOD': 'GET',
+ 'SCRIPT_NAME': '',
'SERVER_NAME': 'testserver',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.1',