From d6524088a85a3b6ee4216c46a2d847eb6500decd Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 19 Apr 2017 07:45:47 -0400 Subject: [PATCH] [1.11.x] Refs #28066 -- Fixed Python 2 failures in sessions_tests. --- tests/sessions_tests/tests.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/sessions_tests/tests.py b/tests/sessions_tests/tests.py index b5f9baa562..5ccccf699b 100644 --- a/tests/sessions_tests/tests.py +++ b/tests/sessions_tests/tests.py @@ -28,7 +28,8 @@ from django.core.cache.backends.base import InvalidCacheBackendError from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation from django.http import HttpResponse from django.test import ( - RequestFactory, TestCase, ignore_warnings, override_settings, + RequestFactory, SimpleTestCase, TestCase, ignore_warnings, + override_settings, ) from django.test.utils import patch_logger from django.utils import six, timezone @@ -512,8 +513,8 @@ class CacheDBSessionWithTimeZoneTests(CacheDBSessionTests): pass -# Don't need DB flushing for these tests, so can use unittest.TestCase as base class -class FileSessionTests(SessionTestsMixin, unittest.TestCase): +# Don't need DB flushing for these tests, so use SimpleTestCase as base class +class FileSessionTests(SessionTestsMixin, SimpleTestCase): backend = FileSession @@ -596,7 +597,7 @@ class FileSessionTests(SessionTestsMixin, unittest.TestCase): self.assertEqual(1, count_sessions()) -class CacheSessionTests(SessionTestsMixin, unittest.TestCase): +class CacheSessionTests(SessionTestsMixin, SimpleTestCase): backend = CacheSession @@ -837,8 +838,8 @@ class SessionMiddlewareTests(TestCase): self.assertEqual(response['Vary'], 'Cookie') -# Don't need DB flushing for these tests, so can use unittest.TestCase as base class -class CookieSessionTests(SessionTestsMixin, unittest.TestCase): +# Don't need DB flushing for these tests, so use SimpleTestCase as base class +class CookieSessionTests(SessionTestsMixin, SimpleTestCase): backend = CookieSession