Browse Source

Fix tutorial005_py310: make 'description' required and update tests accordingly

pull/14751/head
Alberto Zambrano 5 months ago
parent
commit
2682f7d21d
  1. 7
      tests/test_tutorial/test_body/test_tutorial005.py

7
tests/test_tutorial/test_body/test_tutorial005.py

@ -17,12 +17,11 @@ def get_client(request: pytest.FixtureRequest):
def test_required_nullable_field(client: TestClient):
response = client.post("/items/", json={"description": None})
response = client.post("/items/", json={"description": "Some description"})
assert response.status_code == 200
assert response.json() == {"description": None}
assert response.json() == {"description": "Some description"}
def test_required_field_missing(client: TestClient):
response = client.post("/items/", json={})
assert response.status_code == 200
assert response.json() == {"description": None}
assert response.status_code == 422

Loading…
Cancel
Save