25 lines
743 B
Python
25 lines
743 B
Python
from fastapi.testclient import TestClient
|
|
|
|
from app.main import app
|
|
|
|
client = TestClient(app)
|
|
|
|
|
|
def test_demo_advisor_account_matches_core_staff_and_can_start_kyc():
|
|
login = client.post(
|
|
"/api/v1/auth/login",
|
|
json={"username": "advisor_test", "password": "advisor_test"},
|
|
)
|
|
assert login.status_code == 200
|
|
payload = login.json()["data"]
|
|
assert payload["user"]["advisor_id"] == "STAFF-10086"
|
|
|
|
created = client.post(
|
|
"/api/v1/kyc/sessions",
|
|
json={"customer_id": "CUST-1001", "session_type": "new_customer"},
|
|
headers={"Authorization": f"Bearer {payload['access_token']}"},
|
|
)
|
|
|
|
assert created.status_code == 200
|
|
assert created.json()["data"]["customer_id"] == "CUST-1001"
|