1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Refs #28066 -- Fixed nondeterministic ordering test failure in sessions_tests.

Thanks Tim Graham for the review.
This commit is contained in:
Mariusz Felisiak 2017-04-18 17:56:59 +02:00 committed by GitHub
parent 63b36d6419
commit 81f8449402

View File

@ -180,11 +180,11 @@ class SessionTestsMixin:
def test_cycle_with_no_session_cache(self): def test_cycle_with_no_session_cache(self):
self.session['a'], self.session['b'] = 'c', 'd' self.session['a'], self.session['b'] = 'c', 'd'
self.session.save() self.session.save()
prev_data = list(self.session.items()) prev_data = self.session.items()
self.session = self.backend(self.session.session_key) self.session = self.backend(self.session.session_key)
self.assertFalse(hasattr(self.session, '_session_cache')) self.assertFalse(hasattr(self.session, '_session_cache'))
self.session.cycle_key() self.session.cycle_key()
self.assertEqual(list(self.session.items()), prev_data) self.assertCountEqual(self.session.items(), prev_data)
def test_save_doesnt_clear_data(self): def test_save_doesnt_clear_data(self):
self.session['a'] = 'b' self.session['a'] = 'b'