From ae5e90be020446ea650139b624d84eda2968283e Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 4 May 2025 17:24:35 +0200 Subject: [PATCH] Lock the date and time format in the config test, and make it time zone ignorant --- tests/test_base/test_base_config.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_base/test_base_config.py b/tests/test_base/test_base_config.py index be805df0..ee43b86a 100644 --- a/tests/test_base/test_base_config.py +++ b/tests/test_base/test_base_config.py @@ -192,9 +192,11 @@ def testBaseConfig_Localisation(fncPath, tstPaths): # Date Formats # Checks for bug #2325 - assert CONFIG._dLocale.bcp47Name() == "en-GB" - assert CONFIG.localDate(datetime.datetime.fromtimestamp(1746370775)) == "04/05/2025" - assert CONFIG.localDateTime(datetime.datetime.fromtimestamp(1746370775)) == "04/05/2025 16:59" + ts = datetime.datetime.fromtimestamp(1746370775) + CONFIG._dShortDate = "dd/MM/yyyy" + CONFIG._dShortDateTime = "dd/MM/yyyy HH:mm" + assert CONFIG.localDate(ts) == ts.strftime("%d/%m/%Y") + assert CONFIG.localDateTime(ts) == ts.strftime("%d/%m/%Y %H:%M") @pytest.mark.base