From dd262130c4e102401674dae48f77cd923693783a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Ba=C3=B1ados=20Schwerter?= Date: Thu, 17 Oct 2024 19:39:23 +0000 Subject: [PATCH] Make ensuretestdb command resilient to in-memory test databases --- .../CreeDictionary/management/commands/ensuretestdb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CreeDictionary/CreeDictionary/management/commands/ensuretestdb.py b/src/CreeDictionary/CreeDictionary/management/commands/ensuretestdb.py index 5ab6f9dec..2134d76f2 100644 --- a/src/CreeDictionary/CreeDictionary/management/commands/ensuretestdb.py +++ b/src/CreeDictionary/CreeDictionary/management/commands/ensuretestdb.py @@ -23,7 +23,8 @@ def handle(self, *args, **options): def importjson_newer_than_db(): return ( - DEFAULT_TEST_IMPORTJSON_FILE.stat().st_mtime + not settings.TEST_DB_FILE.exists() + or DEFAULT_TEST_IMPORTJSON_FILE.stat().st_mtime > settings.TEST_DB_FILE.stat().st_mtime )