test(auto-router): isolate member preview authorization cache

This commit is contained in:
Tin Chi Lo 2026-09-28 13:19:45 -07:00
parent 60b4e2a530
commit 8ef7ce203e

View file

@ -3181,6 +3181,7 @@ def _configure_member_preview(
) -> UserAPIKeyAuth:
from litellm.proxy import proxy_server
from litellm.proxy._types import UI_TEAM_ID, LiteLLM_TeamTable
from litellm.proxy.common_utils.user_api_key_cache import UserApiKeyCache
team: Final = LiteLLM_TeamTable(
team_id="member-preview-team",
@ -3192,6 +3193,7 @@ def _configure_member_preview(
prisma.db.litellm_teamtable.find_unique = AsyncMock(return_value=team)
prisma.db.litellm_teammembership.find_unique = AsyncMock(return_value=None)
monkeypatch.setattr(proxy_server, "prisma_client", prisma)
monkeypatch.setattr(proxy_server, "user_api_key_cache", UserApiKeyCache())
monkeypatch.setattr(proxy_server, "premium_user", True)
return UserAPIKeyAuth(
user_role=LitellmUserRoles.INTERNAL_USER,