[tests] Validate missing body return code in registration

This commit is contained in:
Cathy Hu 2020-07-02 11:23:16 +02:00
parent 72486ccd04
commit 29c9a9d66d

View file

@ -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