diff options
author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-12-19 15:57:23 +0100 |
---|---|---|
committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-12-22 11:39:18 +0100 |
commit | 65cd74be8e99d06c7861edc5050e34d6444e4d56 (patch) | |
tree | 72431d2a70af3d235543781fadce8e647c746959 /tests/view_tests | |
parent | d4733b6df07b1f8a869eed8eac86869d1d14472c (diff) | |
download | django-65cd74be8e99d06c7861edc5050e34d6444e4d56.tar.gz |
Stopped iterating on INSTALLED_APPS.
Used the app cache's get_app_configs() method instead.
Diffstat (limited to 'tests/view_tests')
-rw-r--r-- | tests/view_tests/tests/test_i18n.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/view_tests/tests/test_i18n.py b/tests/view_tests/tests/test_i18n.py index 42f82251f5..19bbde286c 100644 --- a/tests/view_tests/tests/test_i18n.py +++ b/tests/view_tests/tests/test_i18n.py @@ -5,6 +5,7 @@ from os import path import unittest from django.conf import settings +from django.core.apps import app_cache from django.core.urlresolvers import reverse from django.test import LiveServerTestCase, TestCase from django.test.utils import override_settings @@ -115,9 +116,8 @@ class JsI18NTests(TestCase): available. The Javascript i18n view must return a NON empty language catalog with the proper English translations. See #13726 for more details. """ - extended_apps = list(settings.INSTALLED_APPS) + ['view_tests.app0'] - with self.settings(LANGUAGE_CODE='fr', INSTALLED_APPS=extended_apps): - with override('en-us'): + with app_cache._with_app('view_tests.app0'): + with self.settings(LANGUAGE_CODE='fr'), override('en-us'): response = self.client.get('/views/jsi18n_english_translation/') self.assertContains(response, javascript_quote('this app0 string is to be translated')) @@ -144,9 +144,8 @@ class JsI18NTestsMultiPackage(TestCase): translations of multiple Python packages is requested. See #13388, #3594 and #13514 for more details. """ - extended_apps = list(settings.INSTALLED_APPS) + ['view_tests.app1', 'view_tests.app2'] - with self.settings(LANGUAGE_CODE='en-us', INSTALLED_APPS=extended_apps): - with override('fr'): + with app_cache._with_app('view_tests.app1'), app_cache._with_app('view_tests.app2'): + with self.settings(LANGUAGE_CODE='en-us'), override('fr'): response = self.client.get('/views/jsi18n_multi_packages1/') self.assertContains(response, javascript_quote('il faut traduire cette chaîne de caractères de app1')) @@ -155,9 +154,8 @@ class JsI18NTestsMultiPackage(TestCase): Similar to above but with neither default or requested language being English. """ - extended_apps = list(settings.INSTALLED_APPS) + ['view_tests.app3', 'view_tests.app4'] - with self.settings(LANGUAGE_CODE='fr', INSTALLED_APPS=extended_apps): - with override('es-ar'): + with app_cache._with_app('view_tests.app3'), app_cache._with_app('view_tests.app4'): + with self.settings(LANGUAGE_CODE='fr'), override('es-ar'): response = self.client.get('/views/jsi18n_multi_packages2/') self.assertContains(response, javascript_quote('este texto de app3 debe ser traducido')) |