summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-30 15:42:15 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-30 22:11:17 +0100
commit80d74097b4bd7186ad99b6d41d0ed90347a39b21 (patch)
tree7b00c5113c311aaaeba4393701151e916ae7f9f0 /tests
parent7ed20e015335076fc98ad805eaf241f8a0d872d5 (diff)
Stopped populating the app registry as a side effect.
Since it triggers imports, it shouldn't be done lightly. This commit adds a public API for doing it explicitly, django.setup(), and does it automatically when using manage.py and wsgi.py.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/runtests.py b/tests/runtests.py
index 4c917fbbed..e33533a083 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -9,6 +9,7 @@ import sys
import tempfile
import warnings
+import django
from django import contrib
from django.utils._os import upath
from django.utils import six
@@ -85,7 +86,6 @@ def get_installed():
def setup(verbosity, test_labels):
- import django
from django.apps import apps, AppConfig
from django.conf import settings
from django.test import TransactionTestCase, TestCase
@@ -128,7 +128,7 @@ def setup(verbosity, test_labels):
# Load all the ALWAYS_INSTALLED_APPS.
with warnings.catch_warnings():
warnings.filterwarnings('ignore', 'django.contrib.comments is deprecated and will be removed before Django 1.8.', DeprecationWarning)
- apps.populate_models()
+ django.setup()
# Load all the test model apps.
test_modules = get_test_modules()