grantforge-api / backend /scratch_test.py
GrantForge Bot
Deploy to Hugging Face
afd56bc
import sys
import os
sys.path.insert(0, os.path.abspath("backend"))
from fastapi.testclient import TestClient
from server import app
from core.subscription.middleware import verify_token
app.dependency_overrides[verify_token] = lambda: {"sub": "test_clerk_id_123"}
client = TestClient(app)
response = client.post(
"/api/projects",
json={
"title": "Nowy Projekt",
"description": "Jakiś długi opis...",
"program_type": "KPO",
"program_name": "KPO - Odporność",
"external_context": {
"company_data": {"name": "Test Sp. z o.o.", "status": "Zidentyfikowano"},
"resources": [],
"grant_amount": "do 70%",
},
},
)
print(response.status_code)
print(response.json())