diff --git a/django/contrib/admin/validation.py b/django/contrib/admin/validation.py index 79fa9c672c6..a15967e024a 100644 --- a/django/contrib/admin/validation.py +++ b/django/contrib/admin/validation.py @@ -1,4 +1,4 @@ -from django.apps import app_cache +from django.core.apps import app_cache from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.fields import FieldDoesNotExist diff --git a/django/contrib/admindocs/views.py b/django/contrib/admindocs/views.py index c52e0f0d7f5..dee75fa678b 100644 --- a/django/contrib/admindocs/views.py +++ b/django/contrib/admindocs/views.py @@ -4,10 +4,10 @@ import os import re from django import template -from django.apps import app_cache from django.conf import settings from django.contrib import admin from django.contrib.admin.views.decorators import staff_member_required +from django.core.apps import app_cache from django.db import models from django.core.exceptions import ViewDoesNotExist from django.http import Http404 diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py index 3c5a40c1848..d5fc14dd2a6 100644 --- a/django/contrib/auth/__init__.py +++ b/django/contrib/auth/__init__.py @@ -123,7 +123,7 @@ def get_user_model(): """ Returns the User model that is active in this project. """ - from django.apps import app_cache + from django.core.apps import app_cache try: app_label, model_name = settings.AUTH_USER_MODEL.split('.') diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py index 5f24bf069e6..ec963becc47 100644 --- a/django/contrib/auth/management/__init__.py +++ b/django/contrib/auth/management/__init__.py @@ -6,9 +6,9 @@ from __future__ import unicode_literals import getpass import unicodedata -from django.apps import app_cache, UnavailableApp from django.contrib.auth import (models as auth_app, get_permission_codename, get_user_model) +from django.core.apps import app_cache, UnavailableApp from django.core import exceptions from django.core.management.base import CommandError from django.db import DEFAULT_DB_ALIAS, router diff --git a/django/contrib/auth/tests/test_management.py b/django/contrib/auth/tests/test_management.py index c005e74442e..d9de5a2ad09 100644 --- a/django/contrib/auth/tests/test_management.py +++ b/django/contrib/auth/tests/test_management.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals from datetime import date -from django.apps import app_cache from django.contrib.auth import models, management from django.contrib.auth.management import create_permissions from django.contrib.auth.management.commands import changepassword @@ -9,6 +8,7 @@ from django.contrib.auth.models import User from django.contrib.auth.tests.custom_user import CustomUser from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.contenttypes.models import ContentType +from django.core.apps import app_cache from django.core import exceptions from django.core.management import call_command from django.core.management.base import CommandError diff --git a/django/contrib/comments/views/comments.py b/django/contrib/comments/views/comments.py index 5d7c543adb8..294c7c8e42b 100644 --- a/django/contrib/comments/views/comments.py +++ b/django/contrib/comments/views/comments.py @@ -1,9 +1,9 @@ from django import http -from django.apps import app_cache from django.conf import settings from django.contrib import comments from django.contrib.comments import signals from django.contrib.comments.views.utils import next_redirect, confirmation_view +from django.core.apps import app_cache from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.shortcuts import render_to_response diff --git a/django/contrib/contenttypes/management.py b/django/contrib/contenttypes/management.py index 35a8a7fdc87..7ff08b70f89 100644 --- a/django/contrib/contenttypes/management.py +++ b/django/contrib/contenttypes/management.py @@ -1,5 +1,5 @@ -from django.apps import app_cache, UnavailableApp from django.contrib.contenttypes.models import ContentType +from django.core.apps import app_cache, UnavailableApp from django.db import DEFAULT_DB_ALIAS, router from django.db.models import signals from django.utils.encoding import smart_text diff --git a/django/contrib/contenttypes/models.py b/django/contrib/contenttypes/models.py index 90dea5b8111..98eae0219c3 100644 --- a/django/contrib/contenttypes/models.py +++ b/django/contrib/contenttypes/models.py @@ -1,4 +1,4 @@ -from django.apps import app_cache +from django.core.apps import app_cache from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_text, force_text diff --git a/django/contrib/gis/sitemaps/kml.py b/django/contrib/gis/sitemaps/kml.py index 1e4fc82550f..aa9ae69f5d3 100644 --- a/django/contrib/gis/sitemaps/kml.py +++ b/django/contrib/gis/sitemaps/kml.py @@ -1,4 +1,4 @@ -from django.apps import app_cache +from django.core.apps import app_cache from django.core import urlresolvers from django.contrib.sitemaps import Sitemap from django.contrib.gis.db.models.fields import GeometryField diff --git a/django/contrib/gis/sitemaps/views.py b/django/contrib/gis/sitemaps/views.py index e68523981e3..e55a3716723 100644 --- a/django/contrib/gis/sitemaps/views.py +++ b/django/contrib/gis/sitemaps/views.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import warnings -from django.apps import app_cache +from django.core.apps import app_cache from django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import get_current_site diff --git a/django/apps/__init__.py b/django/core/apps/__init__.py similarity index 100% rename from django/apps/__init__.py rename to django/core/apps/__init__.py diff --git a/django/apps/base.py b/django/core/apps/base.py similarity index 100% rename from django/apps/base.py rename to django/core/apps/base.py diff --git a/django/apps/cache.py b/django/core/apps/cache.py similarity index 100% rename from django/apps/cache.py rename to django/core/apps/cache.py diff --git a/django/core/checks/compatibility/django_1_6_0.py b/django/core/checks/compatibility/django_1_6_0.py index a42249de605..fef8bc3a518 100644 --- a/django/core/checks/compatibility/django_1_6_0.py +++ b/django/core/checks/compatibility/django_1_6_0.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from django.apps import app_cache +from django.core.apps import app_cache from django.db import models diff --git a/django/core/management/base.py b/django/core/management/base.py index 4e95ba82985..aeb27e1f0bd 100644 --- a/django/core/management/base.py +++ b/django/core/management/base.py @@ -341,7 +341,7 @@ class AppCommand(BaseCommand): args = '' def handle(self, *app_labels, **options): - from django.apps import app_cache + from django.core.apps import app_cache if not app_labels: raise CommandError('Enter at least one appname.') try: diff --git a/django/core/management/commands/dumpdata.py b/django/core/management/commands/dumpdata.py index 9aebb6c7d63..fa657bcd723 100644 --- a/django/core/management/commands/dumpdata.py +++ b/django/core/management/commands/dumpdata.py @@ -37,7 +37,7 @@ class Command(BaseCommand): args = '[appname appname.ModelName ...]' def handle(self, *app_labels, **options): - from django.apps import app_cache + from django.core.apps import app_cache format = options.get('format') indent = options.get('indent') @@ -162,7 +162,7 @@ def sort_dependencies(app_list): is serialized before a normal model, and any model with a natural key dependency has it's dependencies serialized first. """ - from django.apps import app_cache + from django.core.apps import app_cache # Process the list of models, and get the list of dependencies model_dependencies = [] models = set() diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py index d35a1efa5a0..562147e4038 100644 --- a/django/core/management/commands/flush.py +++ b/django/core/management/commands/flush.py @@ -2,8 +2,8 @@ import sys from importlib import import_module from optparse import make_option -from django.apps import app_cache from django.conf import settings +from django.core.apps import app_cache from django.db import connections, router, transaction, DEFAULT_DB_ALIAS from django.core.management import call_command from django.core.management.base import NoArgsCommand, CommandError diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py index bfeba68aa61..ee88232d9f0 100644 --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -7,8 +7,8 @@ import warnings import zipfile from optparse import make_option -from django.apps import app_cache from django.conf import settings +from django.core.apps import app_cache from django.core import serializers from django.core.management.base import BaseCommand, CommandError from django.core.management.color import no_style diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py index aaf02708401..3bd7ad42beb 100644 --- a/django/core/management/commands/makemigrations.py +++ b/django/core/management/commands/makemigrations.py @@ -3,7 +3,7 @@ import os import operator from optparse import make_option -from django.apps import app_cache +from django.core.apps import app_cache from django.core.management.base import BaseCommand, CommandError from django.db import connections, DEFAULT_DB_ALIAS, migrations from django.db.migrations.loader import MigrationLoader diff --git a/django/core/management/commands/migrate.py b/django/core/management/commands/migrate.py index a6b9677d2e7..b607e8ee438 100644 --- a/django/core/management/commands/migrate.py +++ b/django/core/management/commands/migrate.py @@ -6,8 +6,8 @@ from importlib import import_module import itertools import traceback -from django.apps import app_cache from django.conf import settings +from django.core.apps import app_cache from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from django.core.management.color import no_style diff --git a/django/core/management/commands/shell.py b/django/core/management/commands/shell.py index 12af8141611..5c189ac9807 100644 --- a/django/core/management/commands/shell.py +++ b/django/core/management/commands/shell.py @@ -66,7 +66,7 @@ class Command(NoArgsCommand): def handle_noargs(self, **options): # XXX: (Temporary) workaround for ticket #1796: force early loading of all # models from installed apps. - from django.apps import app_cache + from django.core.apps import app_cache app_cache.get_models() use_plain = options.get('plain', False) diff --git a/django/core/management/commands/sqlsequencereset.py b/django/core/management/commands/sqlsequencereset.py index 24ec25e8ed5..cc35030a91c 100644 --- a/django/core/management/commands/sqlsequencereset.py +++ b/django/core/management/commands/sqlsequencereset.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from optparse import make_option -from django.apps import app_cache +from django.core.apps import app_cache from django.core.management.base import AppCommand from django.db import connections, DEFAULT_DB_ALIAS diff --git a/django/core/management/sql.py b/django/core/management/sql.py index b2500d3787d..0b6e38124ea 100644 --- a/django/core/management/sql.py +++ b/django/core/management/sql.py @@ -5,8 +5,8 @@ import os import re import warnings -from django.apps import app_cache from django.conf import settings +from django.core.apps import app_cache from django.core.management.base import CommandError from django.db import models, router diff --git a/django/core/management/validation.py b/django/core/management/validation.py index 2b27a7edce3..1cedcb9925a 100644 --- a/django/core/management/validation.py +++ b/django/core/management/validation.py @@ -26,7 +26,7 @@ def get_validation_errors(outfile, app=None): validates all models of all installed apps. Writes errors, if any, to outfile. Returns number of errors. """ - from django.apps import app_cache + from django.core.apps import app_cache from django.db import connection, models from django.db.models.deletion import SET_NULL, SET_DEFAULT diff --git a/django/core/serializers/base.py b/django/core/serializers/base.py index 98fbb081c56..db4b79a0201 100644 --- a/django/core/serializers/base.py +++ b/django/core/serializers/base.py @@ -3,7 +3,7 @@ Module for abstract serializer/unserializer base classes. """ import warnings -from django.apps import app_cache +from django.core.apps import app_cache from django.db import models from django.utils import six diff --git a/django/core/serializers/python.py b/django/core/serializers/python.py index 47edc802173..13d6f01a4e5 100644 --- a/django/core/serializers/python.py +++ b/django/core/serializers/python.py @@ -5,8 +5,8 @@ other serializers. """ from __future__ import unicode_literals -from django.apps import app_cache from django.conf import settings +from django.core.apps import app_cache from django.core.serializers import base from django.db import models, DEFAULT_DB_ALIAS from django.utils.encoding import smart_text, is_protected_type diff --git a/django/core/serializers/xml_serializer.py b/django/core/serializers/xml_serializer.py index e9bea84bb1f..90ad2cf398f 100644 --- a/django/core/serializers/xml_serializer.py +++ b/django/core/serializers/xml_serializer.py @@ -4,8 +4,8 @@ XML serializer. from __future__ import unicode_literals -from django.apps import app_cache from django.conf import settings +from django.core.apps import app_cache from django.core.serializers import base from django.db import models, DEFAULT_DB_ALIAS from django.utils.xmlutils import SimplerXMLGenerator diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py index 86905afe77e..adf3b236ac8 100644 --- a/django/db/backends/__init__.py +++ b/django/db/backends/__init__.py @@ -1268,7 +1268,7 @@ class BaseDatabaseIntrospection(object): If only_existing is True, the resulting list will only include the tables that actually exist in the database. """ - from django.apps import app_cache + from django.core.apps import app_cache from django.db import router tables = set() for app_config in app_cache.get_app_configs(only_with_models_module=True): @@ -1289,7 +1289,7 @@ class BaseDatabaseIntrospection(object): def installed_models(self, tables): "Returns a set of all models represented by the provided list of table names." - from django.apps import app_cache + from django.core.apps import app_cache from django.db import router all_models = [] for app_config in app_cache.get_app_configs(only_with_models_module=True): @@ -1302,7 +1302,7 @@ class BaseDatabaseIntrospection(object): def sequence_list(self): "Returns a list of information about all DB sequences for all models in all apps." - from django.apps import app_cache + from django.core.apps import app_cache from django.db import models, router sequence_list = [] diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py index 69e3b61b874..8314533bbaa 100644 --- a/django/db/backends/sqlite3/schema.py +++ b/django/db/backends/sqlite3/schema.py @@ -1,4 +1,4 @@ -from django.apps.cache import BaseAppCache +from django.core.apps.cache import BaseAppCache from django.db.backends.schema import BaseDatabaseSchemaEditor from django.db.models.fields.related import ManyToManyField diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index 9a54f14e75c..4c12e05add4 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -2,7 +2,7 @@ from importlib import import_module import os import sys -from django.apps import app_cache +from django.core.apps import app_cache from django.db.migrations.recorder import MigrationRecorder from django.db.migrations.graph import MigrationGraph from django.utils import six diff --git a/django/db/migrations/questioner.py b/django/db/migrations/questioner.py index 4a860dcf7e0..8a11559993d 100644 --- a/django/db/migrations/questioner.py +++ b/django/db/migrations/questioner.py @@ -2,7 +2,7 @@ import importlib import os import sys -from django.apps import app_cache +from django.core.apps import app_cache from django.utils import datetime_safe from django.utils.six.moves import input diff --git a/django/db/migrations/recorder.py b/django/db/migrations/recorder.py index bf1cd225c23..1c714ca2721 100644 --- a/django/db/migrations/recorder.py +++ b/django/db/migrations/recorder.py @@ -1,4 +1,4 @@ -from django.apps.cache import BaseAppCache +from django.core.apps.cache import BaseAppCache from django.db import models from django.utils.timezone import now diff --git a/django/db/migrations/state.py b/django/db/migrations/state.py index 6aa44ba1083..2102773b718 100644 --- a/django/db/migrations/state.py +++ b/django/db/migrations/state.py @@ -1,4 +1,4 @@ -from django.apps.cache import BaseAppCache +from django.core.apps.cache import BaseAppCache from django.db import models from django.db.models.options import DEFAULT_NAMES, normalize_unique_together from django.utils import six diff --git a/django/db/migrations/writer.py b/django/db/migrations/writer.py index a23a9b12539..04e00501f9b 100644 --- a/django/db/migrations/writer.py +++ b/django/db/migrations/writer.py @@ -5,7 +5,7 @@ from importlib import import_module import os import types -from django.apps import app_cache +from django.core.apps import app_cache from django.db import models from django.db.migrations.loader import MigrationLoader from django.utils.encoding import force_text diff --git a/django/db/models/base.py b/django/db/models/base.py index 1d514ae1e26..56973d4e382 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -5,8 +5,8 @@ import sys from functools import update_wrapper from django.utils.six.moves import zip -from django.apps import app_cache -from django.apps.cache import MODELS_MODULE_NAME +from django.core.apps import app_cache +from django.core.apps.cache import MODELS_MODULE_NAME import django.db.models.manager # NOQA: Imported to register signal handler. from django.conf import settings from django.core.exceptions import (ObjectDoesNotExist, diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 830ff2efa29..b24323d1cfd 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -9,7 +9,7 @@ import warnings from base64 import b64decode, b64encode from itertools import tee -from django.apps import app_cache +from django.core.apps import app_cache from django.db import connection from django.db.models.query_utils import QueryWrapper from django.conf import settings diff --git a/django/db/models/loading.py b/django/db/models/loading.py index ad267d8462e..5745dbed4d4 100644 --- a/django/db/models/loading.py +++ b/django/db/models/loading.py @@ -1,6 +1,6 @@ import warnings -from django.apps import app_cache +from django.core.apps import app_cache warnings.warn( "The utilities in django.db.models.loading are deprecated " diff --git a/django/db/models/options.py b/django/db/models/options.py index 74090cb921d..386e90b057e 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -5,8 +5,8 @@ import re from bisect import bisect import warnings -from django.apps import app_cache from django.conf import settings +from django.core.apps import app_cache from django.db.models.fields.related import ManyToManyRel from django.db.models.fields import AutoField, FieldDoesNotExist from django.db.models.fields.proxy import OrderWrt diff --git a/django/db/models/signals.py b/django/db/models/signals.py index 8c835e5f5f4..a6822309a39 100644 --- a/django/db/models/signals.py +++ b/django/db/models/signals.py @@ -1,6 +1,6 @@ from collections import defaultdict -from django.apps import app_cache +from django.core.apps import app_cache from django.dispatch import Signal from django.utils import six diff --git a/django/db/utils.py b/django/db/utils.py index 702b1b4ebc1..4d53d252bfc 100644 --- a/django/db/utils.py +++ b/django/db/utils.py @@ -282,6 +282,6 @@ class ConnectionRouter(object): """ Return app models allowed to be synchronized on provided db. """ - from django.apps import app_cache + from django.core.apps import app_cache return [model for model in app_cache.get_models(app, include_auto_created=include_auto_created) if self.allow_migrate(db, model)] diff --git a/django/test/simple.py b/django/test/simple.py index f2d26376dff..6129ce1305e 100644 --- a/django/test/simple.py +++ b/django/test/simple.py @@ -9,7 +9,7 @@ import re import unittest as real_unittest import warnings -from django.apps import app_cache +from django.core.apps import app_cache from django.test import _doctest as doctest from django.test import runner from django.test.utils import compare_xml, strip_quotes diff --git a/django/test/testcases.py b/django/test/testcases.py index 1480889565a..13f56fa6cc1 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -15,9 +15,9 @@ import unittest from unittest import skipIf # NOQA: Imported here for backward compatibility from unittest.util import safe_repr -from django.apps import app_cache from django.conf import settings from django.core import mail +from django.core.apps import app_cache from django.core.exceptions import ValidationError, ImproperlyConfigured from django.core.handlers.wsgi import get_path_info, WSGIHandler from django.core.management import call_command diff --git a/tests/app_cache/models.py b/tests/app_cache/models.py index cc092390abd..99f9f57b67d 100644 --- a/tests/app_cache/models.py +++ b/tests/app_cache/models.py @@ -1,4 +1,4 @@ -from django.apps.cache import BaseAppCache +from django.core.apps.cache import BaseAppCache from django.db import models # We're testing app cache presence on load, so this is handy. diff --git a/tests/app_cache/tests.py b/tests/app_cache/tests.py index 484998232e8..29d5315de02 100644 --- a/tests/app_cache/tests.py +++ b/tests/app_cache/tests.py @@ -1,7 +1,7 @@ from __future__ import absolute_import -from django.apps import app_cache -from django.apps.cache import BaseAppCache +from django.core.apps import app_cache +from django.core.apps.cache import BaseAppCache from django.db import models from django.test import TestCase diff --git a/tests/app_loading/tests.py b/tests/app_loading/tests.py index 69095640403..3cc0ffb3680 100644 --- a/tests/app_loading/tests.py +++ b/tests/app_loading/tests.py @@ -4,8 +4,8 @@ import os import sys from unittest import TestCase -from django.apps import app_cache -from django.apps.cache import AppCache +from django.core.apps import app_cache +from django.core.apps.cache import AppCache from django.test.utils import override_settings from django.utils._os import upath diff --git a/tests/commands_sql/tests.py b/tests/commands_sql/tests.py index 1c2a7f0ffa1..3088ea4d489 100644 --- a/tests/commands_sql/tests.py +++ b/tests/commands_sql/tests.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from django.apps import app_cache +from django.core.apps import app_cache from django.core.management.color import no_style from django.core.management.sql import (sql_create, sql_delete, sql_indexes, sql_destroy_indexes, sql_all) diff --git a/tests/contenttypes_tests/tests.py b/tests/contenttypes_tests/tests.py index a56d1969330..ea61e5e8936 100644 --- a/tests/contenttypes_tests/tests.py +++ b/tests/contenttypes_tests/tests.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from django.apps.cache import BaseAppCache from django.contrib.contenttypes.models import ContentType +from django.core.apps.cache import BaseAppCache from django.db import models from django.test import TestCase diff --git a/tests/defer_regress/tests.py b/tests/defer_regress/tests.py index 442af9f7cf7..3e9651b2d28 100644 --- a/tests/defer_regress/tests.py +++ b/tests/defer_regress/tests.py @@ -2,9 +2,9 @@ from __future__ import unicode_literals from operator import attrgetter -from django.apps import app_cache from django.contrib.contenttypes.models import ContentType from django.contrib.sessions.backends.db import SessionStore +from django.core.apps import app_cache from django.db.models import Count from django.test import TestCase from django.test.utils import override_settings diff --git a/tests/invalid_models/tests.py b/tests/invalid_models/tests.py index 860d5e23a6a..712484c6112 100644 --- a/tests/invalid_models/tests.py +++ b/tests/invalid_models/tests.py @@ -1,7 +1,7 @@ import sys import unittest -from django.apps import app_cache +from django.core.apps import app_cache from django.core.management.validation import get_validation_errors from django.test.utils import override_settings from django.utils.six import StringIO diff --git a/tests/managers_regress/tests.py b/tests/managers_regress/tests.py index 0c939bfd2ec..f2897862ec5 100644 --- a/tests/managers_regress/tests.py +++ b/tests/managers_regress/tests.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from django.apps import app_cache +from django.core.apps import app_cache from django.db import models from django.template import Context, Template from django.test import TestCase diff --git a/tests/migrations/models.py b/tests/migrations/models.py index 9726e4457a7..03390b3a066 100644 --- a/tests/migrations/models.py +++ b/tests/migrations/models.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.apps.cache import BaseAppCache +from django.core.apps.cache import BaseAppCache from django.db import models from django.utils.encoding import python_2_unicode_compatible diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py index a9503e94a87..59cd56e78bf 100644 --- a/tests/migrations/test_commands.py +++ b/tests/migrations/test_commands.py @@ -5,7 +5,7 @@ import codecs import os import shutil -from django.apps import app_cache +from django.core.apps import app_cache from django.core.management import call_command, CommandError from django.test.utils import override_settings from django.utils import six diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py index 13e575862dc..206bf78b352 100644 --- a/tests/migrations/test_state.py +++ b/tests/migrations/test_state.py @@ -1,4 +1,4 @@ -from django.apps.cache import BaseAppCache +from django.core.apps.cache import BaseAppCache from django.db import models from django.db.migrations.state import ProjectState, ModelState, InvalidBasesError from django.test import TestCase diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py index 960af90eaa0..76fe5b5a9e7 100644 --- a/tests/migrations/test_writer.py +++ b/tests/migrations/test_writer.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import datetime import os -from django.apps import app_cache +from django.core.apps import app_cache from django.core.validators import RegexValidator, EmailValidator from django.db import models, migrations from django.db.migrations.writer import MigrationWriter diff --git a/tests/no_models/tests.py b/tests/no_models/tests.py index f9ff80485e6..34ef7244465 100644 --- a/tests/no_models/tests.py +++ b/tests/no_models/tests.py @@ -1,4 +1,4 @@ -from django.apps import app_cache +from django.core.apps import app_cache from django.test import TestCase diff --git a/tests/proxy_model_inheritance/tests.py b/tests/proxy_model_inheritance/tests.py index 4c6e8c433ea..861ab4af170 100644 --- a/tests/proxy_model_inheritance/tests.py +++ b/tests/proxy_model_inheritance/tests.py @@ -3,8 +3,8 @@ from __future__ import unicode_literals import os import sys -from django.apps import app_cache from django.conf import settings +from django.core.apps import app_cache from django.core.management import call_command from django.test import TestCase, TransactionTestCase from django.test.utils import override_settings diff --git a/tests/proxy_models/tests.py b/tests/proxy_models/tests.py index 0c643991a72..3389f3597fd 100644 --- a/tests/proxy_models/tests.py +++ b/tests/proxy_models/tests.py @@ -1,9 +1,9 @@ from __future__ import unicode_literals -from django.apps import app_cache from django.contrib import admin from django.contrib.contenttypes.models import ContentType from django.core import management +from django.core.apps import app_cache from django.core.exceptions import FieldError from django.db import models, DEFAULT_DB_ALIAS from django.db.models import signals diff --git a/tests/runtests.py b/tests/runtests.py index bec2d22feae..d5b94064d5f 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -80,14 +80,14 @@ def get_test_modules(): def get_installed(): - from django.apps import app_cache + from django.core.apps import app_cache return [app_config.name for app_config in app_cache.get_app_configs()] def setup(verbosity, test_labels): import django - from django.apps import app_cache from django.conf import settings + from django.core.apps import app_cache from django.test import TransactionTestCase, TestCase print("Testing against Django installed in '%s'" % os.path.dirname(django.__file__)) diff --git a/tests/schema/models.py b/tests/schema/models.py index 2df97b935cc..e1369bff051 100644 --- a/tests/schema/models.py +++ b/tests/schema/models.py @@ -1,4 +1,4 @@ -from django.apps.cache import BaseAppCache +from django.core.apps.cache import BaseAppCache from django.db import models # Because we want to test creation and deletion of these as separate things, diff --git a/tests/swappable_models/tests.py b/tests/swappable_models/tests.py index 0beb95af3e1..fec9db5af8c 100644 --- a/tests/swappable_models/tests.py +++ b/tests/swappable_models/tests.py @@ -2,9 +2,9 @@ from __future__ import unicode_literals from django.utils.six import StringIO -from django.apps import app_cache from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType +from django.core.apps import app_cache from django.core import management from django.test import TestCase from django.test.utils import override_settings diff --git a/tests/tablespaces/tests.py b/tests/tablespaces/tests.py index a1e2673f38c..4a62ad5a455 100644 --- a/tests/tablespaces/tests.py +++ b/tests/tablespaces/tests.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from django.apps import app_cache from django.conf import settings +from django.core.apps import app_cache from django.db import connection from django.core.management.color import no_style from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature diff --git a/tests/test_runner/tests.py b/tests/test_runner/tests.py index 03cde80aab7..04fa3b8784d 100644 --- a/tests/test_runner/tests.py +++ b/tests/test_runner/tests.py @@ -225,7 +225,7 @@ class ModulesTestsPackages(IgnoreAllDeprecationWarningsMixin, unittest.TestCase) def test_get_tests(self): "Check that the get_tests helper function can find tests in a directory" - from django.apps.base import AppConfig + from django.core.apps.base import AppConfig from django.test.simple import get_tests app_config = AppConfig( 'test_runner.valid_app', @@ -236,7 +236,7 @@ class ModulesTestsPackages(IgnoreAllDeprecationWarningsMixin, unittest.TestCase) def test_import_error(self): "Test for #12658 - Tests with ImportError's shouldn't fail silently" - from django.apps.base import AppConfig + from django.core.apps.base import AppConfig from django.test.simple import get_tests app_config = AppConfig( 'test_runner_invalid_app', diff --git a/tests/test_suite_override/tests.py b/tests/test_suite_override/tests.py index 9666df1c194..b464659275b 100644 --- a/tests/test_suite_override/tests.py +++ b/tests/test_suite_override/tests.py @@ -1,6 +1,6 @@ import unittest -from django.apps import app_cache +from django.core.apps import app_cache from django.test.utils import IgnoreAllDeprecationWarningsMixin diff --git a/tests/validation/test_unique.py b/tests/validation/test_unique.py index 995949fed75..83863b19c6f 100644 --- a/tests/validation/test_unique.py +++ b/tests/validation/test_unique.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import datetime import unittest -from django.apps.cache import BaseAppCache +from django.core.apps.cache import BaseAppCache from django.core.exceptions import ValidationError from django.db import models from django.test import TestCase