-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix tests depending on year 2024 #473
Changes from all commits
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
from __future__ import annotations | ||
|
||
from collections import namedtuple | ||
from datetime import date | ||
|
||
from django.core.exceptions import ValidationError | ||
from django.db import models | ||
|
@@ -299,7 +298,7 @@ def overlapping_with(self, obj) -> DurationModelMixinQuerySet: | |
def active_temporal(self, effective_date=None) -> DurationModelMixinQuerySet: | ||
if not effective_date: | ||
# if no effective date was given, use today as the default | ||
effective_date = date.today() | ||
effective_date = timezone.now() | ||
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 this maybe be 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. Looks like the 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.
Anyway, maybe it's parsed automatically or we ensure timezone-aware dates by |
||
return self.overlapping_with( | ||
# It's impossible to instantiate an abstract model, therefore create a namedtuple here | ||
namedtuple("FakeDurationModelMixin", ["start_date", "end_date"])( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as in
DurationModelMixinQuerySet