🔧 fix(test_database.py): add description field to FlowCreate object to fix test failure caused by missing required field

🐛 fix(test_user.py): update error message and details for invalid UUID input in test_patch_user_wrong_id and test_delete_user_wrong_id to provide more specific information
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-11-02 22:19:58 -03:00
commit 780b0d68d8
2 changed files with 15 additions and 5 deletions

View file

@ -38,7 +38,7 @@ def test_create_flow(
assert response.json()["name"] == flow.name
assert response.json()["data"] == flow.data
# flow is optional so we can create a flow without a flow
flow = FlowCreate(name="Test Flow")
flow = FlowCreate(name="Test Flow", description="description")
response = client.post(
"api/v1/flows/", json=flow.dict(exclude_unset=True), headers=logged_in_headers
)

View file

@ -212,9 +212,14 @@ def test_patch_user_wrong_id(client, active_user, logged_in_headers):
assert response.json() == {
"detail": [
{
"type": "uuid_parsing",
"loc": ["path", "user_id"],
"msg": "value is not a valid uuid",
"type": "type_error.uuid",
"msg": "Input should be a valid UUID, invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `w` at 1",
"input": "wrong_id",
"ctx": {
"error": "invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `w` at 1"
},
"url": "https://errors.pydantic.dev/2.4/v/uuid_parsing",
}
]
}
@ -234,9 +239,14 @@ def test_delete_user_wrong_id(client, test_user, super_user_headers):
assert response.json() == {
"detail": [
{
"type": "uuid_parsing",
"loc": ["path", "user_id"],
"msg": "value is not a valid uuid",
"type": "type_error.uuid",
"msg": "Input should be a valid UUID, invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `w` at 1",
"input": "wrong_id",
"ctx": {
"error": "invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `w` at 1"
},
"url": "https://errors.pydantic.dev/2.4/v/uuid_parsing",
}
]
}