diff options
| author | Tim Graham <timograham@gmail.com> | 2014-05-19 08:22:46 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-05-19 08:22:46 -0400 |
| commit | 5abc811a40dbeee092b9f50055d229e9c24274fa (patch) | |
| tree | 5825f6ff9b917c16a44c25769c3eaa1d9ab1ae36 /tests | |
| parent | a1f0c4c697e8d848ce43ad8ce346a058f288db19 (diff) | |
Revert "Fixed #20477: Allowed settings.FORMAT_MODULE_PATH to be a list of modules."
This reverts commit 950b6de16ac2f8135612f2ed5984c090dd8e4dcf.
Diffstat (limited to 'tests')
7 files changed, 0 insertions, 63 deletions
diff --git a/tests/utils_tests/test_formats.py b/tests/utils_tests/test_formats.py deleted file mode 100644 index 17fa9fdadf..0000000000 --- a/tests/utils_tests/test_formats.py +++ /dev/null @@ -1,59 +0,0 @@ -"""Tests for ``django/utils/formats.py``.""" -from django.test import TestCase -from django.utils.formats import iter_format_modules - - -class IterFormatModulesTestCase(TestCase): - """Tests for the ``iter_format_modules`` method.""" - longMessage = True - - def test_returns_correct_default(self): - """ - Should return default module when FORMAT_MODULE_PATH is not set. - """ - result = list(iter_format_modules('en')) - self.assertEqual(len(result), 1, msg=( - "Should return only Django's default formats module.")) - self.assertEqual( - result[0].__name__, 'django.conf.locale.en.formats', msg=( - 'Should have added the language to the module path')) - - def test_with_setting_as_basestring(self): - """ - Before ticket #20477 FORMAT_MODULE_PATH was supposed to be a string. - - This test ensures backwards compatibility. - """ - with self.settings( - FORMAT_MODULE_PATH='utils_tests.test_module.formats'): - result = list(iter_format_modules('en')) - self.assertEqual(len(result), 2, msg=( - 'Should return both, the default value and the one from the' - ' setting')) - self.assertEqual( - result[0].__name__, - 'utils_tests.test_module.formats.en.formats', - msg=('Should return the module from the setting first and' - ' should have added the language to the module path')) - - def test_with_setting_as_list_of_strings(self): - """ - After ticket #20477 FORMAT_MODULE_PATH can also be a list of strings. - - This tests verifies the new functionality. - """ - FORMAT_MODULE_PATH = [ - 'utils_tests.test_module.formats', - 'utils_tests.test_module.formats2', - ] - with self.settings( - FORMAT_MODULE_PATH=FORMAT_MODULE_PATH): - result = list(iter_format_modules('en')) - self.assertEqual(len(result), 3, msg=( - 'Should return the default value and the two values from the' - ' setting')) - self.assertEqual( - result[0].__name__, - 'utils_tests.test_module.formats.en.formats', - msg=('Should return the values from the setting and add the' - ' language to the module path')) diff --git a/tests/utils_tests/test_module/formats/__init__.py b/tests/utils_tests/test_module/formats/__init__.py deleted file mode 100644 index 6dc04db23d..0000000000 --- a/tests/utils_tests/test_module/formats/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -""" -Custom format module. Used by tests in ``tests/utils_tests/test_formats.py``. - -""" diff --git a/tests/utils_tests/test_module/formats/en/__init__.py b/tests/utils_tests/test_module/formats/en/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/utils_tests/test_module/formats/en/__init__.py +++ /dev/null diff --git a/tests/utils_tests/test_module/formats/en/formats.py b/tests/utils_tests/test_module/formats/en/formats.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/utils_tests/test_module/formats/en/formats.py +++ /dev/null diff --git a/tests/utils_tests/test_module/formats2/__init__.py b/tests/utils_tests/test_module/formats2/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/utils_tests/test_module/formats2/__init__.py +++ /dev/null diff --git a/tests/utils_tests/test_module/formats2/en/__init__.py b/tests/utils_tests/test_module/formats2/en/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/utils_tests/test_module/formats2/en/__init__.py +++ /dev/null diff --git a/tests/utils_tests/test_module/formats2/en/formats.py b/tests/utils_tests/test_module/formats2/en/formats.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/utils_tests/test_module/formats2/en/formats.py +++ /dev/null |
