🔧 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:
parent
5320da2f06
commit
780b0d68d8
2 changed files with 15 additions and 5 deletions
|
|
@ -38,7 +38,7 @@ def test_create_flow(
|
||||||
assert response.json()["name"] == flow.name
|
assert response.json()["name"] == flow.name
|
||||||
assert response.json()["data"] == flow.data
|
assert response.json()["data"] == flow.data
|
||||||
# flow is optional so we can create a flow without a flow
|
# 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(
|
response = client.post(
|
||||||
"api/v1/flows/", json=flow.dict(exclude_unset=True), headers=logged_in_headers
|
"api/v1/flows/", json=flow.dict(exclude_unset=True), headers=logged_in_headers
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -212,9 +212,14 @@ def test_patch_user_wrong_id(client, active_user, logged_in_headers):
|
||||||
assert response.json() == {
|
assert response.json() == {
|
||||||
"detail": [
|
"detail": [
|
||||||
{
|
{
|
||||||
|
"type": "uuid_parsing",
|
||||||
"loc": ["path", "user_id"],
|
"loc": ["path", "user_id"],
|
||||||
"msg": "value is not a valid 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",
|
||||||
"type": "type_error.uuid",
|
"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() == {
|
assert response.json() == {
|
||||||
"detail": [
|
"detail": [
|
||||||
{
|
{
|
||||||
|
"type": "uuid_parsing",
|
||||||
"loc": ["path", "user_id"],
|
"loc": ["path", "user_id"],
|
||||||
"msg": "value is not a valid 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",
|
||||||
"type": "type_error.uuid",
|
"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",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue