summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_autoreload.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-23 10:37:34 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-23 21:37:56 +0100
commitda16bb30ff238aa4d59b4186d92ef5429d8d0045 (patch)
treedfda0b750aa0d3a71c4751edcb7b86f3517e2b3f /tests/utils_tests/test_autoreload.py
parent5241763c81b6afe1c0327ff7eb0d75c643f24ce0 (diff)
Dropped AppCache._empty, _with_app and _without_app.
It's now easier to achieve the same effect with modify_settings or override_settings.
Diffstat (limited to 'tests/utils_tests/test_autoreload.py')
-rw-r--r--tests/utils_tests/test_autoreload.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/utils_tests/test_autoreload.py b/tests/utils_tests/test_autoreload.py
index 5071566e92..1024b02efe 100644
--- a/tests/utils_tests/test_autoreload.py
+++ b/tests/utils_tests/test_autoreload.py
@@ -1,7 +1,6 @@
import os
from django import conf
-from django.apps import app_cache
from django.contrib import admin
from django.test import TestCase, override_settings
from django.utils.autoreload import gen_filenames
@@ -28,6 +27,7 @@ class TestFilenameGenerator(TestCase):
self.assertIn(os.path.join(LOCALE_PATH, 'nl', 'LC_MESSAGES', 'django.mo'),
filenames)
+ @override_settings(INSTALLED_APPS=[])
def test_project_root_locale(self):
"""
Test that gen_filenames also yields from the current directory (project
@@ -36,22 +36,19 @@ class TestFilenameGenerator(TestCase):
old_cwd = os.getcwd()
os.chdir(os.path.dirname(__file__))
try:
- # Remove the current app from the app cache to guarantee that the
- # files will be found thanks to the current working directory.
- with app_cache._empty():
- filenames = list(gen_filenames())
+ filenames = list(gen_filenames())
self.assertIn(
os.path.join(LOCALE_PATH, 'nl', 'LC_MESSAGES', 'django.mo'),
filenames)
finally:
os.chdir(old_cwd)
+ @override_settings(INSTALLED_APPS=['django.contrib.admin'])
def test_app_locales(self):
"""
Test that gen_filenames also yields from locale dirs in installed apps.
"""
- with app_cache._empty(), app_cache._with_app('django.contrib.admin'):
- filenames = list(gen_filenames())
+ filenames = list(gen_filenames())
self.assertIn(os.path.join(os.path.dirname(admin.__file__), 'locale',
'nl', 'LC_MESSAGES', 'django.mo'),
filenames)