1
0
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:
Gagaro
2015-11-25 12:17:59 +01:00
committed by Tim Graham
parent ab33269b00
commit 34d88944f4
7 changed files with 19 additions and 6 deletions

View File

View File

@@ -0,0 +1,2 @@
# A user-defined format
CUSTOM_DAY_FORMAT = 'd/m/Y CUSTOM'

View File

@@ -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):