-
-
Notifications
You must be signed in to change notification settings - Fork 665
Fix #2626: Duplicate scheduled year for single day events #2934
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: main
Are you sure you want to change the base?
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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||||
| import datetime | ||||||||||||
|
|
||||||||||||
| from django.template.loader import render_to_string | ||||||||||||
| from django.test import TestCase | ||||||||||||
|
|
||||||||||||
| from ..models import Event, EventLocation, Calendar | ||||||||||||
|
Check failure on line 6 in apps/events/tests/test_templates.py
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| class TimeTagTemplateTests(TestCase): | ||||||||||||
| def test_single_day_event_year_rendering(self): | ||||||||||||
| """ | ||||||||||||
| Verify that a single-day event does not render the year twice (Issue #2626). | ||||||||||||
| """ | ||||||||||||
| # Create a single day event in the future to trigger the year rendering condition | ||||||||||||
| future_year = datetime.date.today().year + 1 | ||||||||||||
|
|
||||||||||||
| calendar = Calendar.objects.create(name="Test Calendar") | ||||||||||||
|
||||||||||||
| calendar = Calendar.objects.create(name="Test Calendar") | |
| calendar = Calendar.objects.create( | |
| name="Test Calendar", | |
| slug="test-calendar-time-tag-single-day-event", | |
| ) |
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.
This test uses a relative import (
from ..models ...), but the repo’s Ruff config bans all relative imports (flake8-tidy-imports). This will fail lint; switch to absolute imports (e.g.,from apps.events.models import ...). AlsoEventLocationis imported but unused, which will trigger F401.