diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2011-02-12 20:42:39 +0000 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2011-02-12 20:42:39 +0000 |
| commit | eaf17475b28061f9beed778b9711077379daeae1 (patch) | |
| tree | 70ecdfb3f7320919004535997547af0fbca1bd26 | |
| parent | 179fefcf7c1e9c6f0a4db5b31a4444bee24e73fa (diff) | |
Added a test for the PendingDeprecationWarning introduced in r15441. Refs #14924, #15286.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15513 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | tests/regressiontests/i18n/test_warnings.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/regressiontests/i18n/test_warnings.py b/tests/regressiontests/i18n/test_warnings.py index 519749252f..d9899c10b1 100644 --- a/tests/regressiontests/i18n/test_warnings.py +++ b/tests/regressiontests/i18n/test_warnings.py @@ -20,11 +20,22 @@ class DeprecationWarningTests(TestCase): settings.SETTINGS_MODULE = self.old_settings_module settings.LOCALE_PATHS = self.old_locale_paths + def test_warn_if_project_has_locale_subdir(self): + """Test that PendingDeprecationWarning is generated when a deprecated project level locale/ subdir is present.""" + project_path = join(dirname(abspath(__file__)), '..') + warnings.filterwarnings('error', + "Translations in the project directory aren't supported anymore\. Use the LOCALE_PATHS setting instead\.", + PendingDeprecationWarning) + reload(django.utils.translation) + self.assertRaises(PendingDeprecationWarning, django.utils.translation.ugettext, 'Time') + def test_no_warn_if_project_and_locale_paths_overlap(self): """Test that PendingDeprecationWarning isn't generated when a deprecated project level locale/ subdir is also included in LOCALE_PATHS.""" project_path = join(dirname(abspath(__file__)), '..') settings.LOCALE_PATHS += (normpath(join(project_path, 'locale')),) - warnings.filterwarnings('error', "Translations in the project directory aren't supported anymore\. Use the LOCALE_PATHS setting instead\.", PendingDeprecationWarning) + warnings.filterwarnings('error', + "Translations in the project directory aren't supported anymore\. Use the LOCALE_PATHS setting instead\.", + PendingDeprecationWarning) reload(django.utils.translation) try: django.utils.translation.ugettext('Time') |
