summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-04 12:07:45 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-13 09:07:51 +0200
commitd106d07f732013eeb4667e73fa9cfd197e1d3484 (patch)
tree43ded365a1d7f6bb29c22044ec74cf3eee7be303
parent4c5236ef93db714b63eedcc5a162631a6ca1def9 (diff)
Advanced deprecation warnings for Django 3.2.
-rw-r--r--django/utils/deprecation.py7
-rw-r--r--docs/internals/deprecation.txt8
-rwxr-xr-xtests/runtests.py5
3 files changed, 17 insertions, 3 deletions
diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py
index 6336558a81..3582fcf3a3 100644
--- a/django/utils/deprecation.py
+++ b/django/utils/deprecation.py
@@ -5,14 +5,17 @@ import warnings
from asgiref.sync import sync_to_async
-class RemovedInNextVersionWarning(DeprecationWarning):
+class RemovedInDjango40Warning(DeprecationWarning):
pass
-class RemovedInDjango40Warning(PendingDeprecationWarning):
+class RemovedInDjango41Warning(PendingDeprecationWarning):
pass
+RemovedInNextVersionWarning = RemovedInDjango40Warning
+
+
class warn_about_renamed_method:
def __init__(self, class_name, old_method_name, new_method_name, deprecation_warning):
self.class_name = class_name
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 074345ef40..e48356bed1 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 <internal-release-deprecation-policy>`. More details
about each item can often be found in the release notes of two versions prior.
+.. _deprecation-removed-in-4.1:
+
+4.1
+---
+
+See the :ref:`Django 3.2 release notes <deprecated-features-3.2>` for more
+details on these changes.
+
.. _deprecation-removed-in-4.0:
4.0
diff --git a/tests/runtests.py b/tests/runtests.py
index 8264d40684..d79b4b393e 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -24,7 +24,9 @@ else:
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 RemovedInDjango40Warning
+ from django.utils.deprecation import (
+ RemovedInDjango40Warning, RemovedInDjango41Warning,
+ )
from django.utils.log import DEFAULT_LOGGING
from django.utils.version import PY37
@@ -38,6 +40,7 @@ else:
# Make deprecation warnings errors to ensure no usage of deprecated features.
warnings.simplefilter("error", RemovedInDjango40Warning)
+warnings.simplefilter('error', RemovedInDjango41Warning)
# Make resource and runtime warning errors to ensure no usage of error prone
# patterns.
warnings.simplefilter("error", ResourceWarning)