mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Moved contrib.redirects tests out of contrib.
This commit is contained in:
parent
b3cd9e0d07
commit
00da46091a
0
tests/redirects_tests/__init__.py
Normal file
0
tests/redirects_tests/__init__.py
Normal file
@ -1,13 +1,12 @@
|
|||||||
from django import http
|
from django import http
|
||||||
from django.conf import settings
|
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.contrib.sites.models import Site
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.test import TestCase, modify_settings, override_settings
|
from django.test import TestCase, modify_settings, override_settings
|
||||||
from django.utils import six
|
from django.utils import six
|
||||||
|
|
||||||
from .middleware import RedirectFallbackMiddleware
|
|
||||||
from .models import Redirect
|
|
||||||
|
|
||||||
|
|
||||||
@modify_settings(MIDDLEWARE_CLASSES={'append':
|
@modify_settings(MIDDLEWARE_CLASSES={'append':
|
||||||
'django.contrib.redirects.middleware.RedirectFallbackMiddleware'})
|
'django.contrib.redirects.middleware.RedirectFallbackMiddleware'})
|
||||||
@ -65,7 +64,7 @@ class OverriddenRedirectFallbackMiddleware(RedirectFallbackMiddleware):
|
|||||||
|
|
||||||
|
|
||||||
@modify_settings(MIDDLEWARE_CLASSES={'append':
|
@modify_settings(MIDDLEWARE_CLASSES={'append':
|
||||||
'django.contrib.redirects.tests.OverriddenRedirectFallbackMiddleware'})
|
'redirects_tests.tests.OverriddenRedirectFallbackMiddleware'})
|
||||||
@override_settings(SITE_ID=1)
|
@override_settings(SITE_ID=1)
|
||||||
class OverriddenRedirectMiddlewareTests(TestCase):
|
class OverriddenRedirectMiddlewareTests(TestCase):
|
||||||
|
|
@ -66,6 +66,7 @@ ALWAYS_MIDDLEWARE_CLASSES = [
|
|||||||
# before its application was loaded."
|
# before its application was loaded."
|
||||||
CONTRIB_TESTS_TO_APPS = {
|
CONTRIB_TESTS_TO_APPS = {
|
||||||
'flatpages_tests': 'django.contrib.flatpages',
|
'flatpages_tests': 'django.contrib.flatpages',
|
||||||
|
'redirects_tests': 'django.contrib.redirects',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -149,6 +150,7 @@ def setup(verbosity, test_labels):
|
|||||||
'auth': 'django.contrib.auth.tests.migrations',
|
'auth': 'django.contrib.auth.tests.migrations',
|
||||||
'contenttypes': 'django.contrib.contenttypes.tests.migrations',
|
'contenttypes': 'django.contrib.contenttypes.tests.migrations',
|
||||||
'flatpages_tests': 'django.contrib.flatpages.migrations',
|
'flatpages_tests': 'django.contrib.flatpages.migrations',
|
||||||
|
'redirects_tests': 'django.contrib.redirects.migrations',
|
||||||
}
|
}
|
||||||
|
|
||||||
if verbosity > 0:
|
if verbosity > 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user