mirror of https://github.com/django/django.git
[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
This commit is contained in:
parent
14b5073978
commit
2f9378223d
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue