Fixed regression introduced in 146ed13a.

As override_settings was used after the initialization of the session backend,
we need to use a new session backend here.
This commit is contained in:
Mathijs de Bruin 2013-02-23 16:33:28 +01:00 committed by Aymeric Augustin
parent 5278776a88
commit 8c1cc4b3b0
1 changed files with 3 additions and 0 deletions

View File

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