summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_module_loading.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-19 15:57:23 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-22 11:39:18 +0100
commit65cd74be8e99d06c7861edc5050e34d6444e4d56 (patch)
tree72431d2a70af3d235543781fadce8e647c746959 /tests/utils_tests/test_module_loading.py
parentd4733b6df07b1f8a869eed8eac86869d1d14472c (diff)
Stopped iterating on INSTALLED_APPS.
Used the app cache's get_app_configs() method instead.
Diffstat (limited to 'tests/utils_tests/test_module_loading.py')
-rw-r--r--tests/utils_tests/test_module_loading.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/utils_tests/test_module_loading.py b/tests/utils_tests/test_module_loading.py
index 5a7eadcedf..0c8dfe1e12 100644
--- a/tests/utils_tests/test_module_loading.py
+++ b/tests/utils_tests/test_module_loading.py
@@ -5,9 +5,9 @@ import sys
import unittest
from zipimport import zipimporter
+from django.core.apps import app_cache
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase
-from django.test.utils import override_settings
from django.utils import six
from django.utils.module_loading import autodiscover_modules, import_by_path, module_has_submodule
from django.utils._os import upath
@@ -135,9 +135,14 @@ class ModuleImportTestCase(unittest.TestCase):
'Should have more than the calling frame in the traceback.')
-@override_settings(INSTALLED_APPS=('utils_tests.test_module',))
class AutodiscoverModulesTestCase(SimpleTestCase):
+ def setUp(self):
+ self._with_test_module = app_cache._begin_with_app('utils_tests.test_module')
+
+ def tearDown(self):
+ app_cache._end_with_app(self._with_test_module)
+
def test_autodiscover_modules_found(self):
autodiscover_modules('good_module')