1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #36543 -- Fixed time formats for fr_CA.

Thanks Chris Anderson for the report.
This commit is contained in:
Mridul Dhall
2025-08-08 17:12:31 +01:00
committed by Sarah Boyce
parent 748551fea0
commit b67a36ec6f
2 changed files with 24 additions and 3 deletions

View File

@@ -1158,6 +1158,27 @@ class FormattingTests(SimpleTestCase):
),
)
def test_uncommon_locale_formats(self):
testcases = {
# French Canadian locale uses 'h' as time format seperator.
("fr-ca", time_format, (self.t, "TIME_FORMAT")): "10\xa0h\xa015",
(
"fr-ca",
date_format,
(self.dt, "DATETIME_FORMAT"),
): "31 décembre 2009, 20\xa0h\xa050",
(
"fr-ca",
date_format,
(self.dt, "SHORT_DATETIME_FORMAT"),
): "2009-12-31 20\xa0h\xa050",
}
for testcase, expected in testcases.items():
locale, format_function, format_args = testcase
with self.subTest(locale=locale, expected=expected):
with translation.override(locale, deactivate=True):
self.assertEqual(expected, format_function(*format_args))
def test_sub_locales(self):
"""
Check if sublocales fall back to the main locale