Skip to content

Commit

Permalink
Advanced deprecation warnings for Django 6.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahboyce committed Jan 15, 2025
1 parent 17ae61a commit 7bc88c3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions django/utils/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
from asgiref.sync import iscoroutinefunction, markcoroutinefunction, sync_to_async


class RemovedInDjango60Warning(DeprecationWarning):
class RemovedInDjango61Warning(DeprecationWarning):
pass


class RemovedInDjango61Warning(PendingDeprecationWarning):
class RemovedInDjango70Warning(PendingDeprecationWarning):
pass


RemovedInNextVersionWarning = RemovedInDjango60Warning
RemovedAfterNextVersionWarning = RemovedInDjango61Warning
RemovedInNextVersionWarning = RemovedInDjango61Warning
RemovedAfterNextVersionWarning = RemovedInDjango70Warning


class warn_about_renamed_method:
Expand Down
8 changes: 8 additions & 0 deletions docs/internals/deprecation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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-7.0:

7.0
---

See the :ref:`Django 6.0 release notes <deprecated-features-6.0>` for more
details on these changes.

.. _deprecation-removed-in-6.1:

6.1
Expand Down
4 changes: 2 additions & 2 deletions tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
from django.test.selenium import SeleniumTestCase, SeleniumTestCaseBase
from django.test.utils import NullTimeKeeper, TimeKeeper, get_runner
from django.utils.deprecation import (
RemovedInDjango60Warning,
RemovedInDjango61Warning,
RemovedInDjango70Warning,
)
from django.utils.functional import classproperty
from django.utils.log import DEFAULT_LOGGING
Expand All @@ -46,7 +46,7 @@
warnings.filterwarnings("ignore", r"\(1003, *", category=MySQLdb.Warning)

# Make deprecation warnings errors to ensure no usage of deprecated features.
warnings.simplefilter("error", RemovedInDjango60Warning)
warnings.simplefilter("error", RemovedInDjango70Warning)
warnings.simplefilter("error", RemovedInDjango61Warning)
# Make resource and runtime warning errors to ensure no usage of error prone
# patterns.
Expand Down

0 comments on commit 7bc88c3

Please sign in to comment.