fix(test): mock execute_raw in team endpoint tests

These tests mock prisma_client as MagicMock, so db.execute_raw needs to
be explicitly set to AsyncMock for the new atomic team append call

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Krrish Dholakia 2026-07-03 01:29:12 +00:00
parent d383149ab0
commit 93da4cf603

View file

@ -4025,6 +4025,7 @@ async def test_new_team_max_budget_within_user_limit():
mock_prisma.db.litellm_usertable = MagicMock()
mock_prisma.db.litellm_usertable.upsert = AsyncMock(return_value=mock_user)
mock_prisma.db.litellm_usertable.update = AsyncMock(return_value=mock_user)
mock_prisma.db.execute_raw = AsyncMock()
# Mock team membership table
mock_membership = MagicMock()
@ -4166,6 +4167,7 @@ async def test_new_team_org_scoped_budget_bypasses_user_limit():
mock_prisma.db.litellm_usertable = MagicMock()
mock_prisma.db.litellm_usertable.upsert = AsyncMock(return_value=mock_user)
mock_prisma.db.litellm_usertable.update = AsyncMock(return_value=mock_user)
mock_prisma.db.execute_raw = AsyncMock()
# Mock team membership table
mock_membership = MagicMock()
@ -4312,6 +4314,7 @@ async def test_new_team_org_scoped_models_bypasses_user_limit():
mock_prisma.db.litellm_usertable = MagicMock()
mock_prisma.db.litellm_usertable.upsert = AsyncMock(return_value=mock_user)
mock_prisma.db.litellm_usertable.update = AsyncMock(return_value=mock_user)
mock_prisma.db.execute_raw = AsyncMock()
# Mock team membership table
mock_membership = MagicMock()
@ -7164,6 +7167,7 @@ async def test_new_team_soft_budget_validation(
mock_prisma.db.litellm_usertable = MagicMock()
mock_prisma.db.litellm_usertable.upsert = AsyncMock(return_value=mock_user)
mock_prisma.db.litellm_usertable.update = AsyncMock(return_value=mock_user)
mock_prisma.db.execute_raw = AsyncMock()
# Mock team membership table
mock_membership = MagicMock()