Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/downloads/templatetags/download_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ def render_active_releases():
if status == "feature":
status = "pre-release"

# Skip releases that are only planned with no pre-release yet
if status == "planned":
continue

if status == "end-of-life":
# Include only the most recent EOL release
if found_eol:
Expand Down
11 changes: 11 additions & 0 deletions apps/downloads/tests/test_template_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"3.10": {"status": "security", "end_of_life": "2026-10-04", "pep": 619},
"3.14": {"status": "bugfix", "first_release": "2025-10-07", "end_of_life": "2030-10", "pep": 745},
"3.15": {"status": "feature", "first_release": "2026-10-01", "end_of_life": "2031-10", "pep": 790},
"3.16": {"status": "planned", "first_release": "2027-10-06", "end_of_life": "2032-10", "pep": 826},
}


Expand Down Expand Up @@ -234,6 +235,16 @@ def test_eol_status_includes_last_release_link(self, mock_get_data):
self.assertIn("last release was", status)
self.assertIn("<a href=", status)

@mock.patch("apps.downloads.templatetags.download_tags.get_release_cycle_data")
def test_planned_releases_excluded(self, mock_get_data):
"""Test that planned releases are not shown."""
mock_get_data.return_value = MOCK_RELEASE_CYCLE

result = render_active_releases()

versions = [r["version"] for r in result["releases"]]
self.assertNotIn("3.16", versions)

@mock.patch("apps.downloads.templatetags.download_tags.get_release_cycle_data")
def test_api_failure_returns_empty_releases(self, mock_get_data):
"""Test that API failure returns empty releases list."""
Expand Down
Loading