summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathijs de Bruin <mathijs@mathijsfietst.nl>2013-02-23 16:33:28 +0100
committerTim Graham <timograham@gmail.com>2013-07-10 15:05:00 -0400
commit2f9378223d0c92447e2529d5eeaad7d301b78b84 (patch)
tree1ff53ae3b93f019930869a6a87c115e98e7a9263
parent14b50739787d9bb69e763894f78b10971fe2bc63 (diff)
[1.5.x] Fixed #20075 -- Fixed session test fail when using a cache other than LocMemCache.
As override_settings was used after the initialization of the session backend, we need to use a new session backend here. Backport of 8c1cc4b3b0 from master
-rw-r--r--django/contrib/sessions/tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py
index da79ac9de6..8bcc505ee6 100644
--- a/django/contrib/sessions/tests.py
+++ b/django/contrib/sessions/tests.py
@@ -468,6 +468,9 @@ class CacheSessionTests(SessionTestsMixin, unittest.TestCase):
},
}, SESSION_CACHE_ALIAS='sessions')
def test_non_default_cache(self):
+ # Re-initalize the session backend to make use of overridden settings.
+ self.session = self.backend()
+
self.session.save()
self.assertEqual(get_cache('default').get(self.session.cache_key), None)
self.assertNotEqual(get_cache('sessions').get(self.session.cache_key), None)