summaryrefslogtreecommitdiff
path: root/tests/sessions_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-03-30 12:29:56 -0400
committerTim Graham <timograham@gmail.com>2015-03-31 08:38:43 -0400
commit4e59156c10d36eeb1e6fced4dff0f11157f68264 (patch)
tree0ee184dfa4bfaddfea87455303033716594fb1f2 /tests/sessions_tests
parent56286542dbb7d1cca253b25de0eb3eb4392ff271 (diff)
downloaddjango-4e59156c10d36eeb1e6fced4dff0f11157f68264.tar.gz
Fixed sessions test on Python 3.5; refs #23763.
SimpleCookie.__repr__() changed in https://hg.python.org/cpython/rev/88e1151e8e02
Diffstat (limited to 'tests/sessions_tests')
-rw-r--r--tests/sessions_tests/tests.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/sessions_tests/tests.py b/tests/sessions_tests/tests.py
index d042aab225..62804e4dc0 100644
--- a/tests/sessions_tests/tests.py
+++ b/tests/sessions_tests/tests.py
@@ -2,6 +2,7 @@ import base64
import os
import shutil
import string
+import sys
import tempfile
import unittest
from datetime import timedelta
@@ -604,8 +605,11 @@ class SessionMiddlewareTests(TestCase):
# A deleted cookie header looks like:
# Set-Cookie: sessionid=; expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/
self.assertEqual(
- 'Set-Cookie: {}=; expires=Thu, 01-Jan-1970 00:00:00 GMT; '
- 'Max-Age=0; Path=/'.format(settings.SESSION_COOKIE_NAME),
+ 'Set-Cookie: {}={}; expires=Thu, 01-Jan-1970 00:00:00 GMT; '
+ 'Max-Age=0; Path=/'.format(
+ settings.SESSION_COOKIE_NAME,
+ '""' if sys.version_info >= (3, 5) else '',
+ ),
str(response.cookies[settings.SESSION_COOKIE_NAME])
)