diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2011-02-03 15:43:50 +0000 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2011-02-03 15:43:50 +0000 |
| commit | 987fd511769a3e1342fe8678a0b183f2831adb60 (patch) | |
| tree | 2027f8c5857783c86a017f71ec42ca8157912e92 /tests | |
| parent | a158873488b06077f65fce35e9ea57658a64c872 (diff) | |
Fixed stability of data input/output L10N format modules priority order. Thanks tonnzor for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15402 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/i18n/tests.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 055656b3cb..d023462311 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -9,7 +9,7 @@ from threading import local from django.conf import settings from django.template import Template, Context from django.utils.formats import (get_format, date_format, time_format, - localize, localize_input, iter_format_modules) + localize, localize_input, iter_format_modules, get_format_modules) from django.utils.importlib import import_module from django.utils.numberformat import format as nformat from django.utils.safestring import mark_safe, SafeString, SafeUnicode @@ -495,6 +495,19 @@ class FormattingTests(TestCase): finally: settings.USE_L10N = old_l10n + def test_get_format_modules_stability(self): + activate('de') + old_format_module_path = settings.FORMAT_MODULE_PATH + settings.FORMAT_MODULE_PATH = 'regressiontests.i18n.other.locale' + try: + settings.USE_L10N = 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.') + finally: + settings.FORMAT_MODULE_PATH = old_format_module_path + deactivate() + def test_localize_templatetag_and_filter(self): """ Tests the {% localize %} templatetag |
