mirror of https://github.com/django/django.git
[1.8.x] Fixed sessions test on Python 3.5; refs #23763.
SimpleCookie.__repr__() changed in
https://hg.python.org/cpython/rev/88e1151e8e02
Backport of 4e59156c10
from master
This commit is contained in:
parent
793ecf6db7
commit
7b9f7b6670
|
@ -2,6 +2,7 @@ import base64
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import string
|
import string
|
||||||
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
@ -601,8 +602,11 @@ class SessionMiddlewareTests(TestCase):
|
||||||
# A deleted cookie header looks like:
|
# A deleted cookie header looks like:
|
||||||
# Set-Cookie: sessionid=; expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/
|
# Set-Cookie: sessionid=; expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
'Set-Cookie: {}=; expires=Thu, 01-Jan-1970 00:00:00 GMT; '
|
'Set-Cookie: {}={}; expires=Thu, 01-Jan-1970 00:00:00 GMT; '
|
||||||
'Max-Age=0; Path=/'.format(settings.SESSION_COOKIE_NAME),
|
'Max-Age=0; Path=/'.format(
|
||||||
|
settings.SESSION_COOKIE_NAME,
|
||||||
|
'""' if sys.version_info >= (3, 5) else '',
|
||||||
|
),
|
||||||
str(response.cookies[settings.SESSION_COOKIE_NAME])
|
str(response.cookies[settings.SESSION_COOKIE_NAME])
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue