Fixed #29576 -- Corrected the test client's HTTP_COOKIE header.

This commit is contained in:
Thng Kai Yuan 2018-07-18 19:07:02 -07:00 committed by Tim Graham
parent 8d4ab0c41f
commit 71a739f3d7
2 changed files with 10 additions and 1 deletions

View file

@ -1423,3 +1423,9 @@ class RequestFactoryEnvironmentTests(SimpleTestCase):
self.assertEqual(request.META.get('SERVER_PORT'), '80')
self.assertEqual(request.META.get('SERVER_PROTOCOL'), 'HTTP/1.1')
self.assertEqual(request.META.get('SCRIPT_NAME') + request.META.get('PATH_INFO'), '/path/')
def test_cookies(self):
factory = RequestFactory()
factory.cookies.load('A="B"; C="D"; Path=/; Version=1')
request = factory.get('/')
self.assertEqual(request.META['HTTP_COOKIE'], 'A="B"; C="D"')