import pytest
from app.tests.conftest import headers
@pytest.mark.asyncio
async def test_foundation_flow(client):
    assert (await client.get("/health")).status_code==200
    w=await client.post("/api/v1/payment-workspaces",headers=headers(),json={"code":"main","name":"Main","status":"enabled","default_payment_mode":"byo_psp"})
    assert w.status_code==201
    b=await client.post("/api/v1/tenant-bundles",headers=headers(),json={"bundle_code":"payment.byo_psp.basic","is_active":True})
    assert b.status_code==201
    caps=(await client.get("/capabilities",headers=headers())).json()
    assert "payment.byo_psp.basic" in caps["active_bundles"]
