mirror of https://github.com/django/django.git
Changed strategy used to force evaluation of django.utils.translation in tests added in r15508 and r15513 to not use reload(). Thanks Alex for reporting it caused problems.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15554 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9ebc9108de
commit
8c3416f468
|
@ -4,6 +4,7 @@ import warnings
|
||||||
import django
|
import django
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test.utils import get_warnings_state, restore_warnings_state
|
from django.test.utils import get_warnings_state, restore_warnings_state
|
||||||
|
from django.utils.translation import _trans
|
||||||
from django.utils.unittest import TestCase
|
from django.utils.unittest import TestCase
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +27,7 @@ class DeprecationWarningTests(TestCase):
|
||||||
warnings.filterwarnings('error',
|
warnings.filterwarnings('error',
|
||||||
"Translations in the project directory aren't supported anymore\. Use the LOCALE_PATHS setting instead\.",
|
"Translations in the project directory aren't supported anymore\. Use the LOCALE_PATHS setting instead\.",
|
||||||
PendingDeprecationWarning)
|
PendingDeprecationWarning)
|
||||||
reload(django.utils.translation)
|
_trans.__dict__ = {}
|
||||||
self.assertRaises(PendingDeprecationWarning, django.utils.translation.ugettext, 'Time')
|
self.assertRaises(PendingDeprecationWarning, django.utils.translation.ugettext, 'Time')
|
||||||
|
|
||||||
def test_no_warn_if_project_and_locale_paths_overlap(self):
|
def test_no_warn_if_project_and_locale_paths_overlap(self):
|
||||||
|
@ -36,7 +37,7 @@ class DeprecationWarningTests(TestCase):
|
||||||
warnings.filterwarnings('error',
|
warnings.filterwarnings('error',
|
||||||
"Translations in the project directory aren't supported anymore\. Use the LOCALE_PATHS setting instead\.",
|
"Translations in the project directory aren't supported anymore\. Use the LOCALE_PATHS setting instead\.",
|
||||||
PendingDeprecationWarning)
|
PendingDeprecationWarning)
|
||||||
reload(django.utils.translation)
|
_trans.__dict__ = {}
|
||||||
try:
|
try:
|
||||||
django.utils.translation.ugettext('Time')
|
django.utils.translation.ugettext('Time')
|
||||||
except PendingDeprecationWarning:
|
except PendingDeprecationWarning:
|
||||||
|
|
Loading…
Reference in New Issue