Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warnings

Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
This commit is contained in:
Claude Paroz 2014-02-26 22:48:20 +01:00
parent 70ec4d776e
commit 210d0489c5
84 changed files with 287 additions and 189 deletions

View file

@ -11,9 +11,14 @@ import warnings
import django
from django import contrib
from django.utils.deprecation import RemovedInDjango18Warning, RemovedInDjango19Warning
from django.utils._os import upath
from django.utils import six
warnings.simplefilter("default", RemovedInDjango19Warning)
warnings.simplefilter("default", RemovedInDjango18Warning)
CONTRIB_MODULE_PATH = 'django.contrib'
TEST_TEMPLATE_DIR = 'templates'
@ -124,12 +129,12 @@ def setup(verbosity, test_labels):
warnings.filterwarnings(
'ignore',
'django.contrib.comments is deprecated and will be removed before Django 1.8.',
DeprecationWarning
RemovedInDjango18Warning
)
warnings.filterwarnings(
'ignore',
'Model class django.contrib.comments.models.* Django 1.9.',
PendingDeprecationWarning
RemovedInDjango19Warning
)
# Load all the ALWAYS_INSTALLED_APPS.
django.setup()
@ -216,7 +221,7 @@ def django_tests(verbosity, interactive, failfast, test_labels):
'ignore',
"Custom SQL location '<app_label>/models/sql' is deprecated, "
"use '<app_label>/sql' instead.",
PendingDeprecationWarning
RemovedInDjango19Warning
)
failures = test_runner.run_tests(
test_labels or get_installed(), extra_tests=extra_tests)