From e372f5dae274c79f1871a2e850cef67a8369b5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florent=20Thi=C3=A9ry?= <florent.thiery@ubicast.eu> Date: Thu, 2 Mar 2017 15:56:24 +0100 Subject: [PATCH] fix time comparison, refs #20687 --- tests/test_backup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_backup.py b/tests/test_backup.py index 28e16dc9..73b2a4cc 100755 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -24,7 +24,7 @@ def test_last_backup_is_recent(server, client): if status == 0: date = out.strip().split(' ')[-2] pdate = datetime.strptime(date, '%Y-%m-%d') - if datetime.now() - pdate > 2: + if (datetime.now() - pdate).days > 2: print('Backup is older than 2 days') return False else: -- GitLab