Update deprecation hints

This commit is contained in:
Peter Thomassen 2024-04-26 16:50:40 +02:00
parent d38aab39e4
commit d58b8da591
No known key found for this signature in database
GPG Key ID: 5203651ED2F34D28
3 changed files with 5 additions and 5 deletions

View File

@ -23,7 +23,7 @@ HTTP_HEADER_ENCODING = 'iso-8859-1'
ISO_8601 = 'iso-8601'
class RemovedInDRF315Warning(DeprecationWarning):
class RemovedInDRF316Warning(DeprecationWarning):
pass

View File

@ -12,7 +12,7 @@ from django.db import models
from django.utils.encoding import force_str
from rest_framework import (
RemovedInDRF315Warning, exceptions, renderers, serializers
RemovedInDRF316Warning, exceptions, renderers, serializers
)
from rest_framework.compat import inflection, uritemplate
from rest_framework.fields import _UnvalidatedField, empty
@ -725,7 +725,7 @@ class AutoSchema(ViewInspector):
def _get_reference(self, serializer):
warnings.warn(
"Method `_get_reference()` has been renamed to `get_reference()`. "
"The old name will be removed in DRF v3.15.",
RemovedInDRF315Warning, stacklevel=2
"The old name will be removed in DRF v3.16.",
RemovedInDRF316Warning, stacklevel=2
)
return self.get_reference(serializer)

View File

@ -1633,7 +1633,7 @@ class TestCustomTimezoneForDateTimeField(TestCase):
assert rendered_date == rendered_date_in_timezone
@pytest.mark.skipif(pytz is None, reason="As Django 4.0 has deprecated pytz, this test should eventually be able to get removed.")
@pytest.mark.skipif(pytz is None, reason="Django 5.0 has removed pytz; this test should eventually be able to get removed.")
class TestPytzNaiveDayLightSavingTimeTimeZoneDateTimeField(FieldValues):
"""
Invalid values for `DateTimeField` with datetime in DST shift (non-existing or ambiguous) and timezone with DST.