diff options
| author | Tim Graham <timograham@gmail.com> | 2015-01-19 15:12:57 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-01-19 15:41:29 -0500 |
| commit | 7a1ccc069971277d74fde143966de3f3d24c9a91 (patch) | |
| tree | a9223c89cc9ab58cf867be4298fb06112e5a8cdb /django | |
| parent | 3e803f9cbd58f6558066af4a6b54e1b71063ee4a (diff) | |
[1.7.x] Fixed #24153 -- Fixed cookie test compatibility with Python 3.4.3+
Backport of b19b81b3960ec2090d40be65547502a3386a769b from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/sessions/tests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py index 8cda7ea05b..8d63aaa989 100644 --- a/django/contrib/sessions/tests.py +++ b/django/contrib/sessions/tests.py @@ -24,6 +24,7 @@ from django.test import TestCase, RequestFactory, override_settings from django.test.utils import patch_logger from django.utils import six from django.utils import timezone +from django.utils.six.moves import http_cookies from django.contrib.sessions.exceptions import InvalidSessionKey @@ -532,7 +533,7 @@ class SessionMiddlewareTests(unittest.TestCase): response = middleware.process_response(request, response) self.assertTrue( response.cookies[settings.SESSION_COOKIE_NAME]['httponly']) - self.assertIn('httponly', + self.assertIn(http_cookies.Morsel._reserved['httponly'], str(response.cookies[settings.SESSION_COOKIE_NAME])) @override_settings(SESSION_COOKIE_HTTPONLY=False) @@ -549,7 +550,7 @@ class SessionMiddlewareTests(unittest.TestCase): response = middleware.process_response(request, response) self.assertFalse(response.cookies[settings.SESSION_COOKIE_NAME]['httponly']) - self.assertNotIn('httponly', + self.assertNotIn(http_cookies.Morsel._reserved['httponly'], str(response.cookies[settings.SESSION_COOKIE_NAME])) def test_session_save_on_500(self): |
