diff options
| author | Mridul Dhall <mriduldhall@Mriduls-MacBook-Pro.local> | 2025-08-08 17:12:31 +0100 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-09-23 16:53:58 +0200 |
| commit | b15f8ba0716986895dd84cb02e1dda0993c63b7e (patch) | |
| tree | 8d74c0c0410b4b76e59dbb1279a543c4d6cb7f50 /tests | |
| parent | e0f328d790539868252cea10cf40e620b9aecd31 (diff) | |
[6.0.x] Fixed #36543 -- Fixed time formats for fr_CA.
Thanks Chris Anderson for the report.
Backport of b67a36ec6f5895f3fa6147264bae55cb014fa2a7 from main.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/i18n/tests.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py index b4bdf160d6..aac56f5df4 100644 --- a/tests/i18n/tests.py +++ b/tests/i18n/tests.py @@ -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 |
