diff --git a/django/test/client.py b/django/test/client.py
index a5ef075..d6857cf 100644
a
|
b
|
class RequestFactory(object):
|
188 | 188 | environ = { |
189 | 189 | 'HTTP_COOKIE': self.cookies.output(header='', sep='; '), |
190 | 190 | 'REQUEST_METHOD': 'GET', |
| 191 | 'REMOTE_ADDR': '127.0.0.1', |
191 | 192 | 'SERVER_NAME': 'testserver', |
192 | 193 | 'SERVER_PORT': '80', |
193 | 194 | 'SERVER_PROTOCOL': 'HTTP/1.1', |
diff --git a/tests/regressiontests/test_client_regress/models.py b/tests/regressiontests/test_client_regress/models.py
index 18ffffd..ce3d481 100644
a
|
b
|
class RequestFactoryStateTest(TestCase):
|
994 | 994 | def test_request_after_client_2(self): |
995 | 995 | # This test is executed after the previous one |
996 | 996 | self.common_test_that_should_always_pass() |
| 997 | |
| 998 | |
| 999 | class RequestFactoryEnvironmentTests(TestCase): |
| 1000 | """ |
| 1001 | Ensure that environment variables are set correctly in the RequestFactory |
| 1002 | to prevent future regressions. |
| 1003 | """ |
| 1004 | |
| 1005 | def setUp(self): |
| 1006 | self.factory = RequestFactory() |
| 1007 | |
| 1008 | def test_should_set_correct_env_variables(self): |
| 1009 | request = self.factory.get('/') |
| 1010 | |
| 1011 | self.assertEqual(request.META.get('REMOTE_ADDR'), '127.0.0.1') |
| 1012 | self.assertEqual(request.META.get('SERVER_NAME'), 'testserver') |
| 1013 | self.assertEqual(request.META.get('SERVER_PORT'), '80') |
| 1014 | self.assertEqual(request.META.get('SERVER_PROTOCOL'), 'HTTP/1.1') |