From a3fffdca2472885a99e1ea9159a685753cd45738 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Thu, 15 Oct 2015 15:40:08 -0700 Subject: [PATCH] Fixed #25558 -- Fixed nondeterministic test failure on Windows: test_clearsessions_command. The test session without an expiration date added in refs #22938 wasn't always deleted on Windows because get_expiry_age() returns zero and the file backend didn't consider that an expired session. --- django/contrib/sessions/backends/file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/sessions/backends/file.py b/django/contrib/sessions/backends/file.py index 63de2a48c5..9170615f5a 100644 --- a/django/contrib/sessions/backends/file.py +++ b/django/contrib/sessions/backends/file.py @@ -99,7 +99,7 @@ class SessionStore(SessionBase): # Remove expired sessions. expiry_age = self.get_expiry_age(expiry=self._expiry_date(session_data)) - if expiry_age < 0: + if expiry_age <= 0: session_data = {} self.delete() self.create()