summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/i18n/other/__init__.py0
-rw-r--r--tests/regressiontests/i18n/other/locale/__init__.py0
-rw-r--r--tests/regressiontests/i18n/other/locale/de/__init__.py0
-rw-r--r--tests/regressiontests/i18n/other/locale/de/formats.py0
-rw-r--r--tests/regressiontests/i18n/tests.py20
5 files changed, 19 insertions, 1 deletions
diff --git a/tests/regressiontests/i18n/other/__init__.py b/tests/regressiontests/i18n/other/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/regressiontests/i18n/other/__init__.py
diff --git a/tests/regressiontests/i18n/other/locale/__init__.py b/tests/regressiontests/i18n/other/locale/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/regressiontests/i18n/other/locale/__init__.py
diff --git a/tests/regressiontests/i18n/other/locale/de/__init__.py b/tests/regressiontests/i18n/other/locale/de/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/regressiontests/i18n/other/locale/de/__init__.py
diff --git a/tests/regressiontests/i18n/other/locale/de/formats.py b/tests/regressiontests/i18n/other/locale/de/formats.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/regressiontests/i18n/other/locale/de/formats.py
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
index 7e2e9f8228..01f6aa0d3f 100644
--- a/tests/regressiontests/i18n/tests.py
+++ b/tests/regressiontests/i18n/tests.py
@@ -8,10 +8,11 @@ import pickle
from django.conf import settings
from django.template import Template, Context
from django.test import TestCase
-from django.utils.formats import get_format, date_format, time_format, localize, localize_input
+from django.utils.formats import get_format, date_format, time_format, localize, localize_input, iter_format_modules
from django.utils.numberformat import format as nformat
from django.utils.safestring import mark_safe, SafeString, SafeUnicode
from django.utils.translation import ugettext, ugettext_lazy, activate, deactivate, gettext_lazy, to_locale
+from django.utils.importlib import import_module
from forms import I18nForm, SelectDateForm, SelectDateWidget, CompanyForm
@@ -423,6 +424,23 @@ class FormattingTests(TestCase):
finally:
deactivate()
+ def test_iter_format_modules(self):
+ """
+ Tests the iter_format_modules function.
+ """
+ activate('de-at')
+ old_format_module_path = settings.FORMAT_MODULE_PATH
+ try:
+ settings.USE_L10N = True
+ de_format_mod = import_module('django.conf.locale.de.formats')
+ self.assertEqual(list(iter_format_modules('de')), [de_format_mod])
+ settings.FORMAT_MODULE_PATH = 'regressiontests.i18n.other.locale'
+ test_de_format_mod = import_module('regressiontests.i18n.other.locale.de.formats')
+ self.assertEqual(list(iter_format_modules('de')), [test_de_format_mod, de_format_mod])
+ finally:
+ settings.FORMAT_MODULE_PATH = old_format_module_path
+ deactivate()
+
class MiscTests(TestCase):
def test_parse_spec_http_header(self):