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
