From f5060a138583c46e14231b7ca1d256dc1e42f9f9 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 27 Dec 2018 21:00:33 -0500 Subject: [PATCH] Advanced deprecation warnings for Django 3.0. --- django/utils/deprecation.py | 6 +++--- docs/internals/deprecation.txt | 8 ++++++++ tests/runtests.py | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py index 8c7dd050fb..19d8a9bd3a 100644 --- a/django/utils/deprecation.py +++ b/django/utils/deprecation.py @@ -2,15 +2,15 @@ import inspect import warnings -class RemovedInDjango30Warning(DeprecationWarning): +class RemovedInDjango31Warning(DeprecationWarning): pass -class RemovedInDjango31Warning(PendingDeprecationWarning): +class RemovedInDjango40Warning(PendingDeprecationWarning): pass -RemovedInNextVersionWarning = RemovedInDjango30Warning +RemovedInNextVersionWarning = RemovedInDjango31Warning class warn_about_renamed_method: diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 087458fa5e..1a5b98df33 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -7,6 +7,14 @@ in a backward incompatible way, following their deprecation, as per the :ref:`deprecation policy `. More details about each item can often be found in the release notes of two versions prior. +.. _deprecation-removed-in-4.0: + +4.0 +--- + +See the :ref:`Django 3.0 release notes ` for more +details on these changes. + .. _deprecation-removed-in-3.1: 3.1 diff --git a/tests/runtests.py b/tests/runtests.py index 8c30b9d802..871b6c202d 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -19,7 +19,7 @@ from django.test.runner import default_test_processes from django.test.selenium import SeleniumTestCaseBase from django.test.utils import get_runner from django.utils.deprecation import ( - RemovedInDjango30Warning, RemovedInDjango31Warning, + RemovedInDjango31Warning, RemovedInDjango40Warning, ) from django.utils.log import DEFAULT_LOGGING @@ -32,7 +32,7 @@ else: warnings.filterwarnings('ignore', r'\(1003, *', category=MySQLdb.Warning) # Make deprecation warnings errors to ensure no usage of deprecated features. -warnings.simplefilter("error", RemovedInDjango30Warning) +warnings.simplefilter("error", RemovedInDjango40Warning) warnings.simplefilter('error', RemovedInDjango31Warning) # Make runtime warning errors to ensure no usage of error prone patterns. warnings.simplefilter("error", RuntimeWarning)