Skip to content

Commit

Permalink
Fixed #8551 -- Added REMOTE_ADDR to the default Test Client environme…
Browse files Browse the repository at this point in the history
…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
freakboy3742 committed Feb 21, 2009
1 parent 322a6a9 commit cd0611b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django/test/client.py
Expand Up @@ -70,7 +70,7 @@ def __call__(self, environ):
response = middleware_method(request, response) response = middleware_method(request, response)
response = self.apply_response_fixes(request, response) response = self.apply_response_fixes(request, response)
finally: finally:
signals.request_finished.disconnect(close_connection) signals.request_finished.disconnect(close_connection)
signals.request_finished.send(sender=self.__class__) signals.request_finished.send(sender=self.__class__)
signals.request_finished.connect(close_connection) signals.request_finished.connect(close_connection)


Expand Down Expand Up @@ -193,6 +193,7 @@ def request(self, **request):
'HTTP_COOKIE': self.cookies, 'HTTP_COOKIE': self.cookies,
'PATH_INFO': '/', 'PATH_INFO': '/',
'QUERY_STRING': '', 'QUERY_STRING': '',
'REMOTE_ADDR': '127.0.0.1',
'REQUEST_METHOD': 'GET', 'REQUEST_METHOD': 'GET',
'SCRIPT_NAME': '', 'SCRIPT_NAME': '',
'SERVER_NAME': 'testserver', 'SERVER_NAME': 'testserver',
Expand Down

0 comments on commit cd0611b

Please sign in to comment.