mirror of
https://github.com/django/django.git
synced 2024-12-25 02:26:12 +00:00
Fixed #8551 -- Added REMOTE_ADDR to the default Test Client environment. Thanks to schmichael for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9847 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
322a6a9d1d
commit
cd0611bd83
@ -70,7 +70,7 @@ class ClientHandler(BaseHandler):
|
|||||||
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)
|
||||||
|
|
||||||
@ -193,6 +193,7 @@ class Client(object):
|
|||||||
'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',
|
||||||
|
Loading…
Reference in New Issue
Block a user