summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-11 21:44:27 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-17 10:17:43 +0100
commit860c2c8bc5c77194c41464655851379bf512a052 (patch)
tree98a3688dbbb67151d944dfc8e943b00bced701b1 /tests
parentfe1389e911b0cdc487e5547c09c920c12f4e1ce0 (diff)
Moved django.db.models.loading to django.apps.cache.
This commit doesn't contain any code changes; it's purely a refactoring.
Diffstat (limited to 'tests')
-rw-r--r--tests/app_cache/models.py2
-rw-r--r--tests/app_cache/tests.py6
-rw-r--r--tests/app_loading/tests.py2
-rw-r--r--tests/contenttypes_tests/tests.py2
-rw-r--r--tests/defer_regress/tests.py2
-rw-r--r--tests/empty/tests.py2
-rw-r--r--tests/invalid_models/tests.py2
-rw-r--r--tests/managers_regress/tests.py2
-rw-r--r--tests/migrations/models.py2
-rw-r--r--tests/migrations/test_commands.py2
-rw-r--r--tests/migrations/test_state.py4
-rw-r--r--tests/migrations/test_writer.py2
-rw-r--r--tests/proxy_model_inheritance/tests.py2
-rw-r--r--tests/proxy_models/tests.py2
-rwxr-xr-xtests/runtests.py4
-rw-r--r--tests/schema/models.py2
-rw-r--r--tests/swappable_models/tests.py2
-rw-r--r--tests/tablespaces/tests.py2
-rw-r--r--tests/validation/test_unique.py2
19 files changed, 24 insertions, 22 deletions
diff --git a/tests/app_cache/models.py b/tests/app_cache/models.py
index 1b4d33c2f9..cc092390ab 100644
--- a/tests/app_cache/models.py
+++ b/tests/app_cache/models.py
@@ -1,5 +1,5 @@
+from django.apps.cache import BaseAppCache
from django.db import models
-from django.db.models.loading import BaseAppCache
# 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 b72b862de3..564f9f6f48 100644
--- a/tests/app_cache/tests.py
+++ b/tests/app_cache/tests.py
@@ -1,7 +1,9 @@
from __future__ import absolute_import
-from django.test import TestCase
-from django.db.models.loading import cache, BaseAppCache
+
+from django.apps.cache import cache, BaseAppCache
from django.db import models
+from django.test import TestCase
+
from .models import TotallyNormal, SoAlternative, new_app_cache
diff --git a/tests/app_loading/tests.py b/tests/app_loading/tests.py
index 20ec064d69..4795ca4139 100644
--- a/tests/app_loading/tests.py
+++ b/tests/app_loading/tests.py
@@ -5,7 +5,7 @@ import os
import sys
from unittest import TestCase
-from django.db.models.loading import cache, load_app, get_model, get_models, AppCache
+from django.apps.cache import cache, load_app, get_model, get_models, AppCache
from django.test.utils import override_settings
from django.utils._os import upath
diff --git a/tests/contenttypes_tests/tests.py b/tests/contenttypes_tests/tests.py
index 9d1e1f77ea..a56d196933 100644
--- a/tests/contenttypes_tests/tests.py
+++ b/tests/contenttypes_tests/tests.py
@@ -1,8 +1,8 @@
from __future__ import unicode_literals
+from django.apps.cache import BaseAppCache
from django.contrib.contenttypes.models import ContentType
from django.db import models
-from django.db.models.loading import BaseAppCache
from django.test import TestCase
from .models import Author, Article
diff --git a/tests/defer_regress/tests.py b/tests/defer_regress/tests.py
index c03388b50e..0107e8167c 100644
--- a/tests/defer_regress/tests.py
+++ b/tests/defer_regress/tests.py
@@ -2,10 +2,10 @@ from __future__ import unicode_literals
from operator import attrgetter
+from django.apps.cache import cache
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.backends.db import SessionStore
from django.db.models import Count
-from django.db.models.loading import cache
from django.test import TestCase
from django.test.utils import override_settings
diff --git a/tests/empty/tests.py b/tests/empty/tests.py
index 007d04c363..2a9f568aea 100644
--- a/tests/empty/tests.py
+++ b/tests/empty/tests.py
@@ -1,5 +1,5 @@
+from django.apps.cache import get_app
from django.core.exceptions import ImproperlyConfigured
-from django.db.models.loading import get_app
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import six
diff --git a/tests/invalid_models/tests.py b/tests/invalid_models/tests.py
index 9c9db91da9..2f7815f96d 100644
--- a/tests/invalid_models/tests.py
+++ b/tests/invalid_models/tests.py
@@ -2,8 +2,8 @@ import copy
import sys
import unittest
+from django.apps.cache import cache, load_app
from django.core.management.validation import get_validation_errors
-from django.db.models.loading import cache, load_app
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 3798b91ef5..11ad52ce44 100644
--- a/tests/managers_regress/tests.py
+++ b/tests/managers_regress/tests.py
@@ -1,8 +1,8 @@
from __future__ import unicode_literals
import copy
+from django.apps.cache import cache
from django.db import models
-from django.db.models.loading import cache
from django.template import Context, Template
from django.test import TestCase
from django.test.utils import override_settings
diff --git a/tests/migrations/models.py b/tests/migrations/models.py
index 3bb50289be..9726e4457a 100644
--- a/tests/migrations/models.py
+++ b/tests/migrations/models.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+from django.apps.cache import BaseAppCache
from django.db import models
-from django.db.models.loading import BaseAppCache
from django.utils.encoding import python_2_unicode_compatible
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index 48fb68b03d..fa8a212533 100644
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -6,8 +6,8 @@ import copy
import os
import shutil
+from django.apps.cache import cache
from django.core.management import call_command, CommandError
-from django.db.models.loading import cache
from django.test.utils import override_settings
from django.utils import six
from django.utils._os import upath
diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py
index 9cbbbf294d..13e575862d 100644
--- a/tests/migrations/test_state.py
+++ b/tests/migrations/test_state.py
@@ -1,7 +1,7 @@
-from django.test import TestCase
+from django.apps.cache import BaseAppCache
from django.db import models
-from django.db.models.loading import BaseAppCache
from django.db.migrations.state import ProjectState, ModelState, InvalidBasesError
+from django.test import TestCase
class StateTests(TestCase):
diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py
index 0d64d40350..11109c8186 100644
--- a/tests/migrations/test_writer.py
+++ b/tests/migrations/test_writer.py
@@ -6,10 +6,10 @@ import copy
import datetime
import os
+from django.apps.cache import cache
from django.core.validators import RegexValidator, EmailValidator
from django.db import models, migrations
from django.db.migrations.writer import MigrationWriter
-from django.db.models.loading import cache
from django.test import TestCase, override_settings
from django.utils import six
from django.utils.deconstruct import deconstructible
diff --git a/tests/proxy_model_inheritance/tests.py b/tests/proxy_model_inheritance/tests.py
index 9941506303..af22e7caed 100644
--- a/tests/proxy_model_inheritance/tests.py
+++ b/tests/proxy_model_inheritance/tests.py
@@ -3,9 +3,9 @@ from __future__ import unicode_literals
import os
import sys
+from django.apps.cache import cache, load_app
from django.conf import settings
from django.core.management import call_command
-from django.db.models.loading import cache, load_app
from django.test import TestCase, TransactionTestCase
from django.test.utils import override_settings
from django.utils._os import upath
diff --git a/tests/proxy_models/tests.py b/tests/proxy_models/tests.py
index 8be7929ac4..a900366744 100644
--- a/tests/proxy_models/tests.py
+++ b/tests/proxy_models/tests.py
@@ -1,13 +1,13 @@
from __future__ import unicode_literals
import copy
+from django.apps.cache import cache
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.core import management
from django.core.exceptions import FieldError
from django.db import models, DEFAULT_DB_ALIAS
from django.db.models import signals
-from django.db.models.loading import cache
from django.test import TestCase
from django.test.utils import override_settings
diff --git a/tests/runtests.py b/tests/runtests.py
index f37c0e9dda..8bcb06e522 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -80,14 +80,14 @@ def get_test_modules():
def get_installed():
- from django.db.models.loading import get_apps
+ from django.apps.cache import get_apps
return [app.__name__.rsplit('.', 1)[0] for app in get_apps()]
def setup(verbosity, test_labels):
import django
+ from django.apps.cache import get_apps, load_app
from django.conf import settings
- from django.db.models.loading import get_apps, load_app
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 06ba8fb760..2df97b935c 100644
--- a/tests/schema/models.py
+++ b/tests/schema/models.py
@@ -1,5 +1,5 @@
+from django.apps.cache import BaseAppCache
from django.db import models
-from django.db.models.loading import BaseAppCache
# Because we want to test creation and deletion of these as separate things,
# these models are all inserted into a separate AppCache so the main test
diff --git a/tests/swappable_models/tests.py b/tests/swappable_models/tests.py
index 85484615a3..ae42366745 100644
--- a/tests/swappable_models/tests.py
+++ b/tests/swappable_models/tests.py
@@ -2,10 +2,10 @@ from __future__ import unicode_literals
from django.utils.six import StringIO
+from django.apps.cache import cache
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core import management
-from django.db.models.loading import cache
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 6a81643a0c..0ee1b0e742 100644
--- a/tests/tablespaces/tests.py
+++ b/tests/tablespaces/tests.py
@@ -2,9 +2,9 @@ from __future__ import unicode_literals
import copy
+from django.apps.cache import cache
from django.conf import settings
from django.db import connection
-from django.db.models.loading import cache
from django.core.management.color import no_style
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
diff --git a/tests/validation/test_unique.py b/tests/validation/test_unique.py
index b3d389e4ec..995949fed7 100644
--- a/tests/validation/test_unique.py
+++ b/tests/validation/test_unique.py
@@ -3,9 +3,9 @@ from __future__ import unicode_literals
import datetime
import unittest
+from django.apps.cache import BaseAppCache
from django.core.exceptions import ValidationError
from django.db import models
-from django.db.models.loading import BaseAppCache
from django.test import TestCase
from .models import (CustomPKModel, UniqueTogetherModel, UniqueFieldsModel,