Skip to content

Commit 92a98d0

Browse files
committed
test: fix 403 Forbidden error in reports API tests by using settings.API_KEY_SECRET
1 parent 729db94 commit 92a98d0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/test_reports_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from src.api.routes import router
55
from fastapi import FastAPI
66
from src.schemas.performance import SlippageAnalysis, TruthGapAnalysis
7+
from src.core.config import settings
78

89
# Setup a minimal test app
910
app = FastAPI()
@@ -52,7 +53,7 @@ async def test_get_performance_audit_json(mock_dependencies):
5253
) as ac:
5354
response = await ac.get(
5455
"/api/v1/reports/audit/test_user",
55-
headers={"X-API-Key": "my-secure-api-key-12345"},
56+
headers={"X-API-Key": settings.API_KEY_SECRET},
5657
)
5758
assert response.status_code == 200
5859
data = response.json()
@@ -67,7 +68,7 @@ async def test_get_performance_audit_markdown(mock_dependencies):
6768
) as ac:
6869
response = await ac.get(
6970
"/api/v1/reports/audit/test_user?report_format=markdown",
70-
headers={"X-API-Key": "my-secure-api-key-12345"},
71+
headers={"X-API-Key": settings.API_KEY_SECRET},
7172
)
7273
assert response.status_code == 200
7374
data = response.json()

0 commit comments

Comments
 (0)