summaryrefslogtreecommitdiff
path: root/tests/requests
diff options
context:
space:
mode:
authorAlexey <lesha.ogonkov@gmail.com>2017-12-28 00:49:46 +0300
committerTim Graham <timograham@gmail.com>2018-01-02 11:22:59 -0500
commit0afffae4ecb660f2ecb94a756c2ab7729654ecf6 (patch)
tree70bab826d6925834a9d43b27c90a8ff592653a8b /tests/requests
parent5f456408a0f52dc16f627d4a89ced5f52c36ad2f (diff)
Fixed #28965 -- Updated Set-Cookie's Expires date format to follow RFC 7231.
Diffstat (limited to 'tests/requests')
-rw-r--r--tests/requests/tests.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/requests/tests.py b/tests/requests/tests.py
index 4c26bccf4e..fdc2e06e18 100644
--- a/tests/requests/tests.py
+++ b/tests/requests/tests.py
@@ -14,7 +14,7 @@ from django.http.request import split_domain_port
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.test.client import FakePayload
from django.test.utils import freeze_time
-from django.utils.http import cookie_date
+from django.utils.http import http_date
from django.utils.timezone import utc
@@ -234,7 +234,7 @@ class RequestsTests(SimpleTestCase):
response.set_cookie('c', 'old-value')
self.assertEqual(response.cookies['c']['expires'], '')
response.delete_cookie('c')
- self.assertEqual(response.cookies['c']['expires'], 'Thu, 01-Jan-1970 00:00:00 GMT')
+ self.assertEqual(response.cookies['c']['expires'], 'Thu, 01 Jan 1970 00:00:00 GMT')
response.set_cookie('c', 'new-value')
self.assertEqual(response.cookies['c']['expires'], '')
@@ -246,7 +246,7 @@ class RequestsTests(SimpleTestCase):
self.assertIn(
datetime_cookie['expires'],
# assertIn accounts for slight time dependency (#23450)
- ('Sat, 01-Jan-2028 04:05:06 GMT', 'Sat, 01-Jan-2028 04:05:07 GMT')
+ ('Sat, 01 Jan 2028 04:05:06 GMT', 'Sat, 01 Jan 2028 04:05:07 GMT')
)
def test_max_age_expiration(self):
@@ -257,7 +257,7 @@ class RequestsTests(SimpleTestCase):
response.set_cookie('max_age', max_age=10)
max_age_cookie = response.cookies['max_age']
self.assertEqual(max_age_cookie['max-age'], 10)
- self.assertEqual(max_age_cookie['expires'], cookie_date(set_cookie_time + 10))
+ self.assertEqual(max_age_cookie['expires'], http_date(set_cookie_time + 10))
def test_httponly_cookie(self):
response = HttpResponse()