"""Integration: audit policy — Go/Gin backend. Tests SQL audit via ticket audit endpoint.""" import pytest from httpx import AsyncClient from tests.conftest import auth_header class TestAuditPolicy: async def test_audit_sql(self, client: AsyncClient, admin_token: str): resp = await client.post("/api/v1/tickets/audit", headers=auth_header(admin_token), json={ "sql_content": "SELECT * FROM users", "db_type": "mysql", }) assert resp.status_code == 200 async def test_audit_sql_no_auth(self, client: AsyncClient): resp = await client.post("/api/v1/tickets/audit", json={ "sql": "SELECT 1", "db_type": "mysql", }) assert resp.status_code == 401