From 0100466f6339b6de097892dbfdb99ae3e5903fe5 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 14 Oct 2026 10:06:31 -0400 Subject: [PATCH 1/3] test: authenticate the e2e API client as the forum service user The forum HTTP API now requires a staff caller (GHSA-c6fp-f54c-6cv4), and tests/conftest.py's api_client fixture logs in as a staff service account for that reason. tests/e2e/conftest.py overrode that fixture with an anonymous client, so every e2e request got a 403. Drop the override so the e2e suite uses the authenticated fixture from tests/conftest.py. Co-Authored-By: Claude Opus 5.5 --- tests/e2e/conftest.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index 7ee86d5c..0381d407 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -10,7 +10,6 @@ from pymongo.errors import ServerSelectionTimeoutError from forum.mongo import get_database -from test_utils.client import APIClient log = logging.getLogger(__name__) @@ -18,12 +17,6 @@ MONGO_SLEEP_INTERVAL = 5 -@pytest.fixture(name="api_client") -def fixture_api_client() -> APIClient: - """Create an API client for testing.""" - return APIClient() - - def wait_for_mongodb() -> None: """Wait for MongoDB to start.""" db = get_database() From d141beeab468a3f10c727fbd1c62b8296b7b1fef Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 14 Oct 2026 10:11:54 -0400 Subject: [PATCH 2/3] build: drop the unpinned py tox env from the CI matrix The py env runs the same commands as django42 and django52 but leaves Django unpinned, so it installs whatever Django release is newest. This release/0.4.1.x backport branch is not expected to work with the latest unpinned Django: Django 6.1 removed django.utils.cache.cc_delim_re, which the djangorestframework 3.16.1 pinned here still imports, so the py job fails before any test runs. The supported Django versions are still covered by the django42 and django52 envs, which are also the only ones in tox's envlist. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec4c2acb..21bb9264 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: os: [ubuntu-latest] python-version: ['3.11', '3.12'] - toxenv: [py, quality, django42, django52, e2e, package] + toxenv: [quality, django42, django52, e2e, package] steps: - uses: actions/checkout@v4 From 0e45dceb82941637150aa1d43529ce47cd23058a Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 14 Oct 2026 10:17:47 -0400 Subject: [PATCH 3/3] build: pin Django in the e2e tox env Like py, the e2e env installed requirements/test.txt, which has its Django line stripped, and nothing else pinned Django, so it got the newest release (6.1.2). This release/0.4.1.x backport branch is not expected to work with the latest unpinned Django: Django 6.1 removed django.utils.cache.cc_delim_re, which the pinned djangorestframework 3.16.1 still imports. Pin e2e to the Django 4.2 line this branch's requirements/quality.txt already pins. Co-Authored-By: Claude Opus 5.5 --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 94a371ef..055d92bd 100644 --- a/tox.ini +++ b/tox.ini @@ -89,6 +89,7 @@ allowlist_externals = rm touch deps = + Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt commands = make test-e2e