diff --git a/tests/test_litellm/proxy/management_endpoints/test_common_daily_activity.py b/tests/test_litellm/proxy/management_endpoints/test_common_daily_activity.py index 059f7987e54..6b31ecf21a5 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_common_daily_activity.py +++ b/tests/test_litellm/proxy/management_endpoints/test_common_daily_activity.py @@ -2975,6 +2975,7 @@ def _team_spend_row( def _export_prisma(conn: psycopg.Connection, token_rows: Sequence[SimpleNamespace] = ()) -> MagicMock: mock_prisma = MagicMock() mock_prisma.db = MagicMock() + mock_prisma.replica_db = mock_prisma.db mock_prisma.db.query_raw = _psycopg_query_raw(conn, []) mock_prisma.db.litellm_verificationtoken.find_many = AsyncMock(return_value=list(token_rows)) mock_prisma.db.litellm_deletedverificationtoken.find_many = AsyncMock(return_value=[]) diff --git a/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py index 5507f6c8c93..24dadbc290e 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py +++ b/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py @@ -2711,6 +2711,7 @@ async def test_search_user_daily_activity_keys_passes_matched_tokens_to_aggregat ) mock_prisma_client = MagicMock() + mock_prisma_client.replica_db = mock_prisma_client.db mock_prisma_client.db.litellm_verificationtoken.find_many = AsyncMock( return_value=[SimpleNamespace(token="tok-a"), SimpleNamespace(token="tok-b")] ) @@ -2774,6 +2775,7 @@ async def test_search_user_daily_activity_keys_no_match_returns_empty_without_ag ) mock_prisma_client = MagicMock() + mock_prisma_client.replica_db = mock_prisma_client.db mock_prisma_client.db.litellm_verificationtoken.find_many = AsyncMock(return_value=[]) monkeypatch.setattr("litellm.proxy.proxy_server.prisma_client", mock_prisma_client) @@ -2818,6 +2820,7 @@ async def test_search_user_daily_activity_keys_non_admin_scoped_to_caller(monkey ) mock_prisma_client = MagicMock() + mock_prisma_client.replica_db = mock_prisma_client.db mock_prisma_client.db.litellm_verificationtoken.find_many = AsyncMock(return_value=[SimpleNamespace(token="tok-a")]) monkeypatch.setattr("litellm.proxy.proxy_server.prisma_client", mock_prisma_client)