summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-09-16 09:58:12 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-09-20 21:23:01 +0200
commit8b6d0333cf5cfefd55e36969145507bb6acfca10 (patch)
tree3fbd49bffdfeb6f83772e4f8f77b99e4bbdac0b7
parent737fa72ae3de1debe97f0a527eeebda3869aa227 (diff)
Advanced deprecation warnings for Django 4.1.
-rw-r--r--django/utils/deprecation.py5
-rw-r--r--docs/internals/deprecation.txt3
-rwxr-xr-xtests/runtests.py5
3 files changed, 5 insertions, 8 deletions
diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py
index 08f33fa7d3..f64bc3c6fb 100644
--- a/django/utils/deprecation.py
+++ b/django/utils/deprecation.py
@@ -5,7 +5,7 @@ import warnings
from asgiref.sync import sync_to_async
-class RemovedInDjango41Warning(DeprecationWarning):
+class RemovedInNextVersionWarning(DeprecationWarning):
pass
@@ -13,9 +13,6 @@ class RemovedInDjango50Warning(PendingDeprecationWarning):
pass
-RemovedInNextVersionWarning = RemovedInDjango41Warning
-
-
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 29af8cc7e2..202acdf608 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -62,6 +62,9 @@ details on these changes.
* The ability to return a ``str``, rather than a ``SafeString``, when rendering
an ``ErrorDict`` and ``ErrorList`` will be removed.
+See the :ref:`Django 4.1 release notes <deprecated-features-4.1>` for more
+details on these changes.
+
.. _deprecation-removed-in-4.1:
4.1
diff --git a/tests/runtests.py b/tests/runtests.py
index 7e08baa5c0..2ec5d32969 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -26,9 +26,7 @@ else:
from django.test.runner import get_max_test_processes, parallel_type
from django.test.selenium import SeleniumTestCaseBase
from django.test.utils import NullTimeKeeper, TimeKeeper, get_runner
- from django.utils.deprecation import (
- RemovedInDjango41Warning, RemovedInDjango50Warning,
- )
+ from django.utils.deprecation import RemovedInDjango50Warning
from django.utils.log import DEFAULT_LOGGING
try:
@@ -41,7 +39,6 @@ else:
# Make deprecation warnings errors to ensure no usage of deprecated features.
warnings.simplefilter('error', RemovedInDjango50Warning)
-warnings.simplefilter('error', RemovedInDjango41Warning)
# Make resource and runtime warning errors to ensure no usage of error prone
# patterns.
warnings.simplefilter("error", ResourceWarning)