diff --git a/tests/unit/test_api_register.py b/tests/unit/test_api_register.py new file mode 100644 index 0000000..25be547 --- /dev/null +++ b/tests/unit/test_api_register.py @@ -0,0 +1,15 @@ +from fastapi import FastAPI, status +from fastapi.testclient import TestClient +from kibicara.model import Mapping +from kibicara.webapi import router + + +app = FastAPI() +app.include_router(router, prefix='/api') +client = TestClient(app) +Mapping.create_all() + + +def test_register_missing_body(): + response = client.post('/api/admin/register/') + assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY