diff options
| author | Carlton Gibson <carlton.gibson@noumenal.es> | 2022-05-10 15:17:59 +0200 |
|---|---|---|
| committer | Carlton Gibson <carlton@noumenal.es> | 2022-05-17 14:22:06 +0200 |
| commit | cdb2f7f36c1e9460e77f1c116e49ca156b312756 (patch) | |
| tree | 4a82c8ed4ee335a7da66ed222dc1fc47c91aa143 | |
| parent | ca1c3151c3df48f1fb2cd17df9cfe93800254665 (diff) | |
Advanced deprecation warnings for Django 4.2.
| -rw-r--r-- | django/utils/deprecation.py | 7 | ||||
| -rw-r--r-- | docs/internals/deprecation.txt | 8 | ||||
| -rwxr-xr-x | tests/runtests.py | 6 |
3 files changed, 17 insertions, 4 deletions
diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py index 325dade182..10b4758587 100644 --- a/django/utils/deprecation.py +++ b/django/utils/deprecation.py @@ -5,15 +5,16 @@ import warnings from asgiref.sync import sync_to_async -class RemovedInNextVersionWarning(DeprecationWarning): +class RemovedInDjango50Warning(DeprecationWarning): pass -class RemovedInDjango50Warning(PendingDeprecationWarning): +class RemovedInDjango51Warning(PendingDeprecationWarning): pass -RemovedAfterNextVersionWarning = RemovedInDjango50Warning +RemovedInNextVersionWarning = RemovedInDjango50Warning +RemovedAfterNextVersionWarning = RemovedInDjango51Warning class warn_about_renamed_method: diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 73ed9a3c6b..7bef5e7db5 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-5.1: + +5.1 +--- + +See the :ref:`Django 4.2 release notes <deprecated-features-4.2>` for more +details on these changes. + .. _deprecation-removed-in-5.0: 5.0 diff --git a/tests/runtests.py b/tests/runtests.py index e5adb902c3..b5cea631b0 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -29,7 +29,10 @@ else: from django.test.runner import _init_worker, 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 RemovedInDjango50Warning + from django.utils.deprecation import ( + RemovedInDjango50Warning, + RemovedInDjango51Warning, + ) from django.utils.log import DEFAULT_LOGGING try: @@ -42,6 +45,7 @@ else: # Make deprecation warnings errors to ensure no usage of deprecated features. warnings.simplefilter("error", RemovedInDjango50Warning) +warnings.simplefilter("error", RemovedInDjango51Warning) # Make resource and runtime warning errors to ensure no usage of error prone # patterns. warnings.simplefilter("error", ResourceWarning) |
