Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit eaf17475b28061f9beed778b9711077379daeae1 1 parent 179fefc
Ramiro Morales ramiro authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 tests/regressiontests/i18n/test_warnings.py
13 tests/regressiontests/i18n/test_warnings.py
View
@@ -20,11 +20,22 @@ def tearDown(self):
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')
Please sign in to comment.
Something went wrong with that request. Please try again.