mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-17 11:42:34 +03:00
Fix test with Django 5 when pytz is available
This commit is contained in:
parent
33d59fefaa
commit
656d83562f
|
@ -16,6 +16,7 @@ try:
|
|||
except ImportError:
|
||||
pytz = None
|
||||
|
||||
import django
|
||||
from django.core.exceptions import ValidationError as DjangoValidationError
|
||||
from django.db.models import IntegerChoices, TextChoices
|
||||
from django.http import QueryDict
|
||||
|
@ -1624,7 +1625,8 @@ class TestCustomTimezoneForDateTimeField(TestCase):
|
|||
assert rendered_date == rendered_date_in_timezone
|
||||
|
||||
|
||||
@pytest.mark.skipif(pytz is None, reason="Django 5.0 has removed pytz; this test should eventually be able to get removed.")
|
||||
@pytest.mark.skipif(pytz is None or django.VERSION >= (5,),
|
||||
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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user