Fixed sessions test on Python 3.5; refs #23763.

SimpleCookie.__repr__() changed in
https://hg.python.org/cpython/rev/88e1151e8e02
This commit is contained in:
Tim Graham 2015-03-30 12:29:56 -04:00
parent 56286542db
commit 4e59156c10
1 changed files with 6 additions and 2 deletions

View File

@ -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])
)