import pytest
from httpx import AsyncClient
from main import app  # Adjust import

@pytest.mark.asyncio
async def test_upload_document():
    async with AsyncClient(app=app, base_url="http://test") as ac:
        response = await ac.post("/documents", json={
            "metadata": {"authority_id": "test", "reference_number": "123", "doc_type": "NOTICE", "issued_at": "2025-12-01T00:00:00Z"},
            "encrypted_payload": "dummy_base64"
        })
        assert response.status_code == 201