diff --git a/tests/redirects_tests/__init__.py b/tests/redirects_tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/django/contrib/redirects/tests.py b/tests/redirects_tests/tests.py similarity index 94% rename from django/contrib/redirects/tests.py rename to tests/redirects_tests/tests.py index 3bed0e02e5..faa8cfe023 100644 --- a/django/contrib/redirects/tests.py +++ b/tests/redirects_tests/tests.py @@ -1,13 +1,12 @@ from django import http from django.conf import settings +from django.contrib.redirects.middleware import RedirectFallbackMiddleware +from django.contrib.redirects.models import Redirect from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, modify_settings, override_settings from django.utils import six -from .middleware import RedirectFallbackMiddleware -from .models import Redirect - @modify_settings(MIDDLEWARE_CLASSES={'append': 'django.contrib.redirects.middleware.RedirectFallbackMiddleware'}) @@ -65,7 +64,7 @@ class OverriddenRedirectFallbackMiddleware(RedirectFallbackMiddleware): @modify_settings(MIDDLEWARE_CLASSES={'append': - 'django.contrib.redirects.tests.OverriddenRedirectFallbackMiddleware'}) + 'redirects_tests.tests.OverriddenRedirectFallbackMiddleware'}) @override_settings(SITE_ID=1) class OverriddenRedirectMiddlewareTests(TestCase): diff --git a/tests/runtests.py b/tests/runtests.py index 3616d019e9..2f23ffdcb5 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -66,6 +66,7 @@ ALWAYS_MIDDLEWARE_CLASSES = ( # before its application was loaded." CONTRIB_TESTS_TO_APPS = { 'flatpages_tests': 'django.contrib.flatpages', + 'redirects_tests': 'django.contrib.redirects', } @@ -151,6 +152,7 @@ def setup(verbosity, test_labels): 'auth': 'django.contrib.auth.tests.migrations', 'contenttypes': 'django.contrib.contenttypes.tests.migrations', 'flatpages_tests': 'django.contrib.flatpages.migrations', + 'redirects_tests': 'django.contrib.redirects.migrations', } if verbosity > 0: