Skip to content
Browse files

[1.5.x] Fixed #20075 -- Fixed session test fail when using a cache ot…

…her 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 8c1cc4b from master
  • Loading branch information...
1 parent 14b5073 commit 2f9378223d0c92447e2529d5eeaad7d301b78b84 @dokterbob dokterbob committed with timgraham
Showing with 3 additions and 0 deletions.
  1. +3 −0 django/contrib/sessions/
3 django/contrib/sessions/
@@ -468,6 +468,9 @@ def test_default_cache(self):
}, 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.assertEqual(get_cache('default').get(self.session.cache_key), None)
self.assertNotEqual(get_cache('sessions').get(self.session.cache_key), None)

0 comments on commit 2f93782

Please sign in to comment.
Something went wrong with that request. Please try again.