refactor: update dict to model_dump

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-23 22:34:28 -03:00
commit 61c34915a9
2 changed files with 5 additions and 6 deletions

View file

@ -180,7 +180,6 @@ async def simplified_run_flow(
stream=stream,
api_key_user=api_key_user,
)
except ValueError as exc:
if "badly formed hexadecimal UUID string" in str(exc):
# This means the Flow ID is not a valid UUID which means it can't find the flow

View file

@ -90,7 +90,7 @@ def test_data_consistency_after_update(client, active_user, logged_in_headers, s
user_id = active_user.id
update_data = UserUpdate(is_active=False)
response = client.patch(f"/api/v1/users/{user_id}", json=update_data.dict(), headers=super_user_headers)
response = client.patch(f"/api/v1/users/{user_id}", json=update_data.model_dump(), headers=super_user_headers)
assert response.status_code == 200, response.json()
# Fetch the updated user from the database
@ -164,13 +164,13 @@ def test_patch_user(client, active_user, logged_in_headers):
username="newname",
)
response = client.patch(f"/api/v1/users/{user_id}", json=update_data.dict(), headers=logged_in_headers)
response = client.patch(f"/api/v1/users/{user_id}", json=update_data.model_dump(), headers=logged_in_headers)
assert response.status_code == 200, response.json()
update_data = UserUpdate(
profile_image="new_image",
)
response = client.patch(f"/api/v1/users/{user_id}", json=update_data.dict(), headers=logged_in_headers)
response = client.patch(f"/api/v1/users/{user_id}", json=update_data.model_dump(), headers=logged_in_headers)
assert response.status_code == 200, response.json()
@ -182,7 +182,7 @@ def test_patch_reset_password(client, active_user, logged_in_headers):
response = client.patch(
f"/api/v1/users/{user_id}/reset-password",
json=update_data.dict(),
json=update_data.model_dump(),
headers=logged_in_headers,
)
assert response.status_code == 200, response.json()
@ -198,7 +198,7 @@ def test_patch_user_wrong_id(client, active_user, logged_in_headers):
username="newname",
)
response = client.patch(f"/api/v1/users/{user_id}", json=update_data.dict(), headers=logged_in_headers)
response = client.patch(f"/api/v1/users/{user_id}", json=update_data.model_dump(), headers=logged_in_headers)
assert response.status_code == 422, response.json()
json_response = response.json()
detail = json_response["detail"]