From 83aeadbb1a308e278f4697649154b2a4af453957 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 8 Aug 2026 03:08:16 +0000 Subject: [PATCH] fix(test): assert _add_team_member_budget_table returns a copy, not mutation PR #36234 refactored _add_team_member_budget_table to return model_copy(update=...) instead of mutating its input, but the success test still asserted result == team_info_response, which now fails because the input stays unmutated with team_member_budget_table=None while the returned copy carries the budget record. Rewrite the assertions to pin the new no-mutation contract: the return value is a distinct object, the input's budget field is untouched, the copy has the budget attached, and the other fields still match. Co-authored-by: Krrish Dholakia --- .../proxy/management_endpoints/test_team_endpoints.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 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..446e74f3355 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py +++ b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py @@ -924,18 +924,18 @@ async def test_add_team_member_budget_table_success(): team_id="test-team-123", team_alias="Test Team" ) - # Call the function result = await _add_team_member_budget_table( team_member_budget_id="budget-123", prisma_client=mock_prisma_client, team_info_response_object=team_info_response, ) - # Verify the result - assert result == team_info_response + assert result is not team_info_response + assert team_info_response.team_member_budget_table is None assert result.team_member_budget_table == mock_budget_record + assert result.team_id == team_info_response.team_id + assert result.team_alias == team_info_response.team_alias - # Verify database call was made correctly mock_prisma_client.db.litellm_budgettable.find_unique.assert_called_once_with( where={"budget_id": "budget-123"} )