Commit 4e59156c authored by Tim Graham's avatar Tim Graham
Browse files

Fixed sessions test on Python 3.5; refs #23763.

SimpleCookie.__repr__() changed in
https://hg.python.org/cpython/rev/88e1151e8e02
parent 56286542
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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])
        )