Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #8551 -- Added REMOTE_ADDR to the default Test Client environme…

…nt. Thanks to schmichael for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9847 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit cd0611bd83ecc404bf250a24062aa5071a072353 1 parent 322a6a9
@freakboy3742 freakboy3742 authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/test/client.py
View
3  django/test/client.py
@@ -70,7 +70,7 @@ def __call__(self, environ):
response = middleware_method(request, response)
response = self.apply_response_fixes(request, response)
finally:
- signals.request_finished.disconnect(close_connection)
+ signals.request_finished.disconnect(close_connection)
signals.request_finished.send(sender=self.__class__)
signals.request_finished.connect(close_connection)
@@ -193,6 +193,7 @@ def request(self, **request):
'HTTP_COOKIE': self.cookies,
'PATH_INFO': '/',
'QUERY_STRING': '',
+ 'REMOTE_ADDR': '127.0.0.1',
'REQUEST_METHOD': 'GET',
'SCRIPT_NAME': '',
'SERVER_NAME': 'testserver',
Please sign in to comment.
Something went wrong with that request. Please try again.