From 0b2c049f53363121c40f08a28faf83e413a12208 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 14 Oct 2026 10:06:36 -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 f734ec18c5e4649659c43b622294db8464d55ba6 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 14 Oct 2026 10:11:56 -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.2.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 fc9cf227..e809c673 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: os: [ubuntu-latest] python-version: ['3.12'] - toxenv: [py, quality, django42, django52, e2e, package] + toxenv: [quality, django42, django52, e2e, package] steps: - uses: actions/checkout@v4 From 974a714accd7a828705d8c414cff24bc71056b1d Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 14 Oct 2026 10:17:48 -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.2.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 5.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 5e383d25..a0f75e69 100644 --- a/tox.ini +++ b/tox.ini @@ -89,6 +89,7 @@ allowlist_externals = rm touch deps = + Django>=5.2,<5.3 -r{toxinidir}/requirements/test.txt commands = make test-e2e