Browse Source

Advanced deprecation warnings for Django 4.1.

Mariusz Felisiak 3 years ago
parent
commit
8b6d0333cf
3 changed files with 5 additions and 8 deletions
  1. 1 4
      django/utils/deprecation.py
  2. 3 0
      docs/internals/deprecation.txt
  3. 1 4
      tests/runtests.py

+ 1 - 4
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

+ 3 - 0
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

+ 1 - 4
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)