-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Fix test with Django 5 when pytz is available #9715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
656d835
4e42975
5b25346
3817fb9
d3ff351
a0fbdbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,3 +5,4 @@ pytest-django>=4.5.2,<5.0 | |||||
importlib-metadata<5.0 | ||||||
# temporary pin of attrs | ||||||
attrs==22.1.0 | ||||||
pytz | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a note here, similar to
from the skip reason? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, we can, won't hurt. How about this?
Suggested change
However, if I was making the change to drop support for Django<5.0, I'd probably remove the skip from the test and forget about this file... Would help to clean it up later in case we forget though 👍🏻 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
except ImportError: | ||
pytz = None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This try/except block is no longer need, is it? The assumption is that we should always have |
||
|
||
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,10 @@ def test_should_render_date_time_in_default_timezone(self): | |
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( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've just expanded the diff further down and realised that we can probably remove the |
||
condition=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. | ||
|
Uh oh!
There was an error while loading. Please reload this page.