refactor: update dict to model_dump
This commit is contained in:
parent
152f0254c0
commit
61c34915a9
2 changed files with 5 additions and 6 deletions
|
|
@ -180,7 +180,6 @@ async def simplified_run_flow(
|
||||||
stream=stream,
|
stream=stream,
|
||||||
api_key_user=api_key_user,
|
api_key_user=api_key_user,
|
||||||
)
|
)
|
||||||
|
|
||||||
except ValueError as exc:
|
except ValueError as exc:
|
||||||
if "badly formed hexadecimal UUID string" in str(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
|
# This means the Flow ID is not a valid UUID which means it can't find the flow
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ def test_data_consistency_after_update(client, active_user, logged_in_headers, s
|
||||||
user_id = active_user.id
|
user_id = active_user.id
|
||||||
update_data = UserUpdate(is_active=False)
|
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()
|
assert response.status_code == 200, response.json()
|
||||||
|
|
||||||
# Fetch the updated user from the database
|
# Fetch the updated user from the database
|
||||||
|
|
@ -164,13 +164,13 @@ def test_patch_user(client, active_user, logged_in_headers):
|
||||||
username="newname",
|
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()
|
assert response.status_code == 200, response.json()
|
||||||
update_data = UserUpdate(
|
update_data = UserUpdate(
|
||||||
profile_image="new_image",
|
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()
|
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(
|
response = client.patch(
|
||||||
f"/api/v1/users/{user_id}/reset-password",
|
f"/api/v1/users/{user_id}/reset-password",
|
||||||
json=update_data.dict(),
|
json=update_data.model_dump(),
|
||||||
headers=logged_in_headers,
|
headers=logged_in_headers,
|
||||||
)
|
)
|
||||||
assert response.status_code == 200, response.json()
|
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",
|
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()
|
assert response.status_code == 422, response.json()
|
||||||
json_response = response.json()
|
json_response = response.json()
|
||||||
detail = json_response["detail"]
|
detail = json_response["detail"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue