mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #25812 -- Restored the ability to use custom formats with the date template filter.
This commit is contained in:
0
tests/i18n/other/locale/fr/__init__.py
Normal file
0
tests/i18n/other/locale/fr/__init__.py
Normal file
2
tests/i18n/other/locale/fr/formats.py
Normal file
2
tests/i18n/other/locale/fr/formats.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# A user-defined format
|
||||
CUSTOM_DAY_FORMAT = 'd/m/Y CUSTOM'
|
||||
@@ -1252,6 +1252,11 @@ class FormattingTests(SimpleTestCase):
|
||||
def test_format_arbitrary_settings(self):
|
||||
self.assertEqual(get_format('DEBUG'), 'DEBUG')
|
||||
|
||||
def test_get_custom_format(self):
|
||||
with self.settings(FORMAT_MODULE_PATH='i18n.other.locale'):
|
||||
with translation.override('fr', deactivate=True):
|
||||
self.assertEqual('d/m/Y CUSTOM', get_format('CUSTOM_DAY_FORMAT'))
|
||||
|
||||
|
||||
class MiscTests(SimpleTestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user