mirror of https://github.com/django/django.git
Fixed #32941 -- Removed get_format_modules()'s unused reverse argument.
Unused since 0d8b523422
.
This commit is contained in:
parent
37ec8721df
commit
59942a66ce
|
@ -86,16 +86,13 @@ def iter_format_modules(lang, format_module_path=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def get_format_modules(lang=None, reverse=False):
|
def get_format_modules(lang=None):
|
||||||
"""Return a list of the format modules found."""
|
"""Return a list of the format modules found."""
|
||||||
if lang is None:
|
if lang is None:
|
||||||
lang = get_language()
|
lang = get_language()
|
||||||
if lang not in _format_modules_cache:
|
if lang not in _format_modules_cache:
|
||||||
_format_modules_cache[lang] = list(iter_format_modules(lang, settings.FORMAT_MODULE_PATH))
|
_format_modules_cache[lang] = list(iter_format_modules(lang, settings.FORMAT_MODULE_PATH))
|
||||||
modules = _format_modules_cache[lang]
|
return _format_modules_cache[lang]
|
||||||
if reverse:
|
|
||||||
return list(reversed(modules))
|
|
||||||
return modules
|
|
||||||
|
|
||||||
|
|
||||||
def get_format(format_type, lang=None, use_l10n=None):
|
def get_format(format_type, lang=None, use_l10n=None):
|
||||||
|
|
|
@ -23,9 +23,9 @@ from django.test import (
|
||||||
)
|
)
|
||||||
from django.utils import translation
|
from django.utils import translation
|
||||||
from django.utils.formats import (
|
from django.utils.formats import (
|
||||||
date_format, get_format, get_format_modules, iter_format_modules, localize,
|
date_format, get_format, iter_format_modules, localize, localize_input,
|
||||||
localize_input, reset_format_cache, sanitize_separators,
|
reset_format_cache, sanitize_separators, sanitize_strftime_format,
|
||||||
sanitize_strftime_format, time_format,
|
time_format,
|
||||||
)
|
)
|
||||||
from django.utils.numberformat import format as nformat
|
from django.utils.numberformat import format as nformat
|
||||||
from django.utils.safestring import SafeString, mark_safe
|
from django.utils.safestring import SafeString, mark_safe
|
||||||
|
@ -1196,13 +1196,6 @@ class FormattingTests(SimpleTestCase):
|
||||||
with translation.override('de', deactivate=True):
|
with translation.override('de', deactivate=True):
|
||||||
self.assertEqual('.', get_format('DECIMAL_SEPARATOR', lang='en'))
|
self.assertEqual('.', get_format('DECIMAL_SEPARATOR', lang='en'))
|
||||||
|
|
||||||
def test_get_format_modules_stability(self):
|
|
||||||
with self.settings(FORMAT_MODULE_PATH='i18n.other.locale'):
|
|
||||||
with translation.override('de', deactivate=True):
|
|
||||||
old = "%r" % get_format_modules(reverse=True)
|
|
||||||
new = "%r" % get_format_modules(reverse=True) # second try
|
|
||||||
self.assertEqual(new, old, 'Value returned by get_formats_modules() must be preserved between calls.')
|
|
||||||
|
|
||||||
def test_localize_templatetag_and_filter(self):
|
def test_localize_templatetag_and_filter(self):
|
||||||
"""
|
"""
|
||||||
Test the {% localize %} templatetag and the localize/unlocalize filters.
|
Test the {% localize %} templatetag and the localize/unlocalize filters.
|
||||||
|
|
Loading…
Reference in New Issue