diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py index bfff066..b25e49e 100644 --- a/backend/tests/conftest.py +++ b/backend/tests/conftest.py @@ -109,7 +109,11 @@ async def client(tmp_path: Path): test_app.state.start_time = datetime.now(timezone.utc) transport = ASGITransport(app=test_app) - async with AsyncClient(transport=transport, base_url="http://test") as ac: + async with AsyncClient( + transport=transport, + base_url="http://test", + headers={"X-Requested-With": "XMLHttpRequest"}, + ) as ac: yield ac # Teardown diff --git a/backend/tests/test_api.py b/backend/tests/test_api.py index 4f28a5c..cb76fb4 100644 --- a/backend/tests/test_api.py +++ b/backend/tests/test_api.py @@ -185,8 +185,16 @@ async def test_session_isolation(client, tmp_path): transport = ASGITransport(app=test_app) - async with AsyncClient(transport=transport, base_url="http://test") as client_a: - async with AsyncClient(transport=transport, base_url="http://test") as client_b: + async with AsyncClient( + transport=transport, + base_url="http://test", + headers={"X-Requested-With": "XMLHttpRequest"}, + ) as client_a: + async with AsyncClient( + transport=transport, + base_url="http://test", + headers={"X-Requested-With": "XMLHttpRequest"}, + ) as client_b: await client_a.post( "/api/downloads", json={"url": "https://example.com/a"},