From 3173d9a850043b31eefbb8b1dbc1e66cbdf31a15 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 18 Apr 2017 17:56:59 +0200 Subject: [PATCH] [1.11.x] Refs #28066 -- Fixed nondeterministic ordering test failure in sessions_tests. Thanks Tim Graham for the review. Backport of 81f844940279140d27578fc6a5b134763ffcceb6 from master --- tests/sessions_tests/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sessions_tests/tests.py b/tests/sessions_tests/tests.py index 7f32ca8be2..b5f9baa562 100644 --- a/tests/sessions_tests/tests.py +++ b/tests/sessions_tests/tests.py @@ -191,11 +191,11 @@ class SessionTestsMixin(object): def test_cycle_with_no_session_cache(self): self.session['a'], self.session['b'] = 'c', 'd' self.session.save() - prev_data = list(self.session.items()) + prev_data = self.session.items() self.session = self.backend(self.session.session_key) self.assertFalse(hasattr(self.session, '_session_cache')) 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): self.session['a'] = 'b'