[tests] Validate missing body return code in registration
This commit is contained in:
parent
72486ccd04
commit
29c9a9d66d
15
tests/unit/test_api_register.py
Normal file
15
tests/unit/test_api_register.py
Normal 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
|
Loading…
Reference in a new issue