summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-01-13 03:02:32 +0000
committerRamiro Morales <cramm0@gmail.com>2011-01-13 03:02:32 +0000
commitfd12e3b2186e47653b25efccec28cee68bd20f7e (patch)
tree462b795d478af2d2ac6539da5fed4d4eed7fd977 /tests/regressiontests
parent1c56af676d02aa0cdb70bb3749971f1cac4afdb3 (diff)
Fixed #15024 -- Ensure that choice of L10N format module used is stable given a stable setup of format modules in ll/ and ll_CC/ dirs. Thanks David Reynolds for the report and suggestions leading to the solution.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/i18n/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
index 0a6f621e3c..98c0ed9aaa 100644
--- a/tests/regressiontests/i18n/tests.py
+++ b/tests/regressiontests/i18n/tests.py
@@ -480,6 +480,19 @@ class FormattingTests(TestCase):
settings.FORMAT_MODULE_PATH = old_format_module_path
deactivate()
+ def test_iter_format_modules_stability(self):
+ """
+ Tests the iter_format_modules function always yields format modules in
+ a stable and correct order in presence of both base ll and ll_CC formats.
+ """
+ try:
+ old_l10n, settings.USE_L10N = settings.USE_L10N, True
+ en_format_mod = import_module('django.conf.locale.en.formats')
+ en_gb_format_mod = import_module('django.conf.locale.en_GB.formats')
+ self.assertEqual(list(iter_format_modules('en-gb')), [en_gb_format_mod, en_format_mod])
+ finally:
+ settings.USE_L10N = old_l10n
+
def test_localize_templatetag_and_filter(self):
"""
Tests the {% localize %} templatetag