TorbatYar/backend/services/payment/app/tests/conftest.py
Mortezakoohjani 9fac160258 feat(payment): ship Torbat Pay MVP phases 14.0-14.5
Add independent payment-service (port 8012, payment_db) with foundation licensing, BYO-PSP, merchant accounts, idempotent requests, callbacks, and immutable ledger.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 17:57:04 +03:30

19 lines
755 B
Python

import os, uuid
os.environ["ENVIRONMENT"]="test"
os.environ["AUTH_REQUIRED"]="false"
os.environ["PAYMENT_DATABASE_URL"]="sqlite+aiosqlite:///:memory:"
os.environ["PAYMENT_DATABASE_URL_SYNC"]="sqlite:///:memory:"
import pytest_asyncio
from httpx import ASGITransport, AsyncClient
from app.core.database import Base, engine
import app.models
from app.main import app
TENANT_A=uuid.uuid4()
TENANT_B=uuid.uuid4()
def headers(t=TENANT_A): return {"X-Tenant-ID":str(t)}
@pytest_asyncio.fixture
async def client():
async with engine.begin() as c:
await c.run_sync(Base.metadata.drop_all); await c.run_sync(Base.metadata.create_all)
async with AsyncClient(transport=ASGITransport(app=app),base_url="http://test") as ac: yield ac