From 1f5e156cb7bb1ebc37f6c4429dccc56a4c3fd663 Mon Sep 17 00:00:00 2001 From: Pablo Pajuelo Cabezas Date: Wed, 11 Dec 2024 15:55:51 +0100 Subject: [PATCH] set fixed locale --- app/src/test/java/org/dhis2/utils/DateUtilsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/test/java/org/dhis2/utils/DateUtilsTest.java b/app/src/test/java/org/dhis2/utils/DateUtilsTest.java index e2adb7ca3b..6f36b07b27 100644 --- a/app/src/test/java/org/dhis2/utils/DateUtilsTest.java +++ b/app/src/test/java/org/dhis2/utils/DateUtilsTest.java @@ -28,6 +28,8 @@ public class DateUtilsTest { @Test public void expiryPeriodAndDaysInRange() throws ParseException { + Locale.setDefault(new Locale("es", "ES")); + String testDateInRange = "2018-07-31"; Date dateInRange = DateUtils.oldUiDateFormat().parse(testDateInRange); @@ -82,8 +84,6 @@ public void expiryPeriodAndDaysInRange() throws ParseException { assertEquals("2018-07-26", DateUtils.oldUiDateFormat().format(minDateWeeklyThursday)); assertEquals("2018-07-28", DateUtils.oldUiDateFormat().format(minDateWeeklySaturday)); assertEquals("2018-07-29", DateUtils.oldUiDateFormat().format(minDateWeeklySunday)); - Log.d("CHECK", "minDateBiWeekly: " + DateUtils.oldUiDateFormat().format(minDateBiWeekly)); - Log.d("CHECK", "expected: 2018-07-16"); assertEquals("2018-07-16", DateUtils.oldUiDateFormat().format(minDateBiWeekly)); assertEquals("2018-06-18", DateUtils.oldUiDateFormat().format(minDateBiWeekly2)); assertEquals("2018-07-01", DateUtils.oldUiDateFormat().format(minDateMonthly));