mirror of https://github.com/django/django.git
Advanced deprecation warnings for Django 5.1.
This commit is contained in:
parent
f72f420f17
commit
caf87b4d42
|
@ -4,7 +4,7 @@ import warnings
|
||||||
from asgiref.sync import iscoroutinefunction, markcoroutinefunction, sync_to_async
|
from asgiref.sync import iscoroutinefunction, markcoroutinefunction, sync_to_async
|
||||||
|
|
||||||
|
|
||||||
class RemovedInDjango51Warning(DeprecationWarning):
|
class RemovedInNextVersionWarning(DeprecationWarning):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ class RemovedInDjango60Warning(PendingDeprecationWarning):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
RemovedInNextVersionWarning = RemovedInDjango51Warning
|
|
||||||
RemovedAfterNextVersionWarning = RemovedInDjango60Warning
|
RemovedAfterNextVersionWarning = RemovedInDjango60Warning
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,11 @@ details on these changes.
|
||||||
* ``get_prefetcher()`` and ``prefetch_related_objects()`` will no longer
|
* ``get_prefetcher()`` and ``prefetch_related_objects()`` will no longer
|
||||||
fallback to ``get_prefetch_queryset()``.
|
fallback to ``get_prefetch_queryset()``.
|
||||||
|
|
||||||
|
See the :ref:`Django 5.1 release notes <deprecated-features-5.1>` for more
|
||||||
|
details on these changes.
|
||||||
|
|
||||||
|
* ...
|
||||||
|
|
||||||
.. _deprecation-removed-in-5.1:
|
.. _deprecation-removed-in-5.1:
|
||||||
|
|
||||||
5.1
|
5.1
|
||||||
|
|
|
@ -28,10 +28,7 @@ else:
|
||||||
from django.test.runner import get_max_test_processes, parallel_type
|
from django.test.runner import get_max_test_processes, parallel_type
|
||||||
from django.test.selenium import SeleniumTestCaseBase
|
from django.test.selenium import SeleniumTestCaseBase
|
||||||
from django.test.utils import NullTimeKeeper, TimeKeeper, get_runner
|
from django.test.utils import NullTimeKeeper, TimeKeeper, get_runner
|
||||||
from django.utils.deprecation import (
|
from django.utils.deprecation import RemovedInDjango60Warning
|
||||||
RemovedInDjango51Warning,
|
|
||||||
RemovedInDjango60Warning,
|
|
||||||
)
|
|
||||||
from django.utils.log import DEFAULT_LOGGING
|
from django.utils.log import DEFAULT_LOGGING
|
||||||
from django.utils.version import PY312
|
from django.utils.version import PY312
|
||||||
|
|
||||||
|
@ -45,7 +42,6 @@ else:
|
||||||
|
|
||||||
# Make deprecation warnings errors to ensure no usage of deprecated features.
|
# Make deprecation warnings errors to ensure no usage of deprecated features.
|
||||||
warnings.simplefilter("error", RemovedInDjango60Warning)
|
warnings.simplefilter("error", RemovedInDjango60Warning)
|
||||||
warnings.simplefilter("error", RemovedInDjango51Warning)
|
|
||||||
# Make resource and runtime warning errors to ensure no usage of error prone
|
# Make resource and runtime warning errors to ensure no usage of error prone
|
||||||
# patterns.
|
# patterns.
|
||||||
warnings.simplefilter("error", ResourceWarning)
|
warnings.simplefilter("error", ResourceWarning)
|
||||||
|
|
Loading…
Reference in New Issue