summaryrefslogtreecommitdiff
path: root/tests/invalid_models_tests
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/invalid_models_tests
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/invalid_models_tests')
-rw-r--r--tests/invalid_models_tests/tests.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/invalid_models_tests/tests.py b/tests/invalid_models_tests/tests.py
index 09c19d453c..852e1dbb0d 100644
--- a/tests/invalid_models_tests/tests.py
+++ b/tests/invalid_models_tests/tests.py
@@ -3,7 +3,7 @@ import unittest
from django.apps import app_cache
from django.core.management.validation import get_validation_errors
-from django.test.utils import override_settings
+from django.test import override_settings
from django.utils.six import StringIO
@@ -26,14 +26,14 @@ class InvalidModelTestCase(unittest.TestCase):
# easier to set this up as an override than to require every developer
# to specify a value in their test settings.
@override_settings(
+ INSTALLED_APPS=['invalid_models_tests.invalid_models'],
TEST_SWAPPED_MODEL='invalid_models.ReplacementModel',
TEST_SWAPPED_MODEL_BAD_VALUE='not-a-model',
TEST_SWAPPED_MODEL_BAD_MODEL='not_an_app.Target',
)
def test_invalid_models(self):
- with app_cache._with_app("invalid_models_tests.invalid_models"):
- module = app_cache.get_app_config("invalid_models").models_module
- get_validation_errors(self.stdout, module)
+ module = app_cache.get_app_config("invalid_models").models_module
+ get_validation_errors(self.stdout, module)
self.stdout.seek(0)
error_log = self.stdout.read()