diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-05-13 13:29:31 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-05-13 13:29:31 +0000 |
| commit | 21e84194b5bab63f60f5d9f39d4c5ba5b1bbb5d7 (patch) | |
| tree | 1bd61fc1ba329e15201bad1da5dc23fd3f553fa8 /tests/regressiontests/admin_views | |
| parent | b29b0f8cac486f6733c2b768feccd83b62a13a9c (diff) | |
Fixed #13514 -- Corrected the process of loading multiple javascript translation catalogs. Thanks to jtiai for the report, to Ramiro Morales for working out the test case, and to Ramiro and Jannis for their help on the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_views')
| -rw-r--r-- | tests/regressiontests/admin_views/tests.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index a516cf1b64..1385e5e0aa 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -4,7 +4,6 @@ import re import datetime from django.conf import settings from django.core.files import temp as tempfile -from django.test import TestCase from django.contrib.auth import admin # Register auth models with the admin. from django.contrib.auth.models import User, Permission, UNUSABLE_PASSWORD from django.contrib.contenttypes.models import ContentType @@ -13,15 +12,16 @@ from django.contrib.admin.sites import LOGIN_FORM_KEY from django.contrib.admin.util import quote from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.forms.util import ErrorList +from django.test import TestCase from django.utils import formats from django.utils.cache import get_max_age +from django.utils.encoding import iri_to_uri from django.utils.html import escape from django.utils.translation import get_date_formats, activate, deactivate -from django.utils.encoding import iri_to_uri # local test models from models import Article, BarAccount, CustomArticle, EmptyModel, \ - ExternalSubscriber, FooAccount, Gallery, ModelWithStringPrimaryKey, \ + FooAccount, Gallery, ModelWithStringPrimaryKey, \ Person, Persona, Picture, Podcast, Section, Subscriber, Vodcast, \ Language, Collector, Widget, Grommet, DooHickey, FancyDoodad, Whatsit, \ Category, Post, Plot, FunkyTag @@ -36,9 +36,11 @@ class AdminViewBasicTest(TestCase): urlbit = 'admin' def setUp(self): + self.old_language_code = settings.LANGUAGE_CODE self.client.login(username='super', password='secret') def tearDown(self): + settings.LANGUAGE_CODE = self.old_language_code self.client.logout() def testTrailingSlashRequired(self): @@ -278,26 +280,22 @@ class AdminViewBasicTest(TestCase): if the default language is non-English but the selected language is English. See #13388 and #3594 for more details. """ - old_language_code = settings.LANGUAGE_CODE settings.LANGUAGE_CODE = 'fr' activate('en-us') response = self.client.get('/test_admin/admin/jsi18n/') self.assertNotContains(response, 'Choisir une heure') deactivate() - settings.LANGUAGE_CODE = old_language_code def testI18NLanguageNonEnglishFallback(self): """ Makes sure that the fallback language is still working properly in cases where the selected language cannot be found. """ - old_language_code = settings.LANGUAGE_CODE settings.LANGUAGE_CODE = 'fr' activate('none') response = self.client.get('/test_admin/admin/jsi18n/') self.assertContains(response, 'Choisir une heure') deactivate() - settings.LANGUAGE_CODE = old_language_code class SaveAsTests(TestCase): |
