From de6e23869c321cf25017028d79daae8e0dd6a7a2 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 8 Aug 2026 01:09:38 +0000 Subject: [PATCH] test(proxy): update team budget helper test for non-mutating return The _add_team_member_budget_table helper was changed in #36234 to return a model_copy of its input rather than mutating in place. The existing test still asserted result == team_info_response (Pydantic structural equality), which now fails because the returned copy has the budget table set while the original does not. Assert the preserved fields plus the new budget attachment, and add a regression guard that the input response object is not mutated. Co-authored-by: Krrish Dholakia --- .../proxy/management_endpoints/test_team_endpoints.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py index a1cbc77b7a5..be4cd66353c 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py +++ b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py @@ -931,9 +931,10 @@ async def test_add_team_member_budget_table_success(): team_info_response_object=team_info_response, ) - # Verify the result - assert result == team_info_response + assert result.team_id == team_info_response.team_id + assert result.team_alias == team_info_response.team_alias assert result.team_member_budget_table == mock_budget_record + assert team_info_response.team_member_budget_table is None # Verify database call was made correctly mock_prisma_client.db.litellm_budgettable.find_unique.assert_called_once_with(