fix(tests): set premium_user=True in JWT tests that call user_api_key_auth

JWT auth is an enterprise-only feature. Tests that call user_api_key_auth
with enable_jwt_auth=True must set premium_user=True on the proxy server
to bypass the enterprise gate, otherwise they fail with:

  ValueError: JWT Auth is an enterprise only feature.

This follows the same pattern as PR #21285 (fix/jwt-enterprise-license-test).

Fixed tests:
- test_team_token_output
- test_allowed_routes_admin
- test_allow_access_by_email
- test_end_user_jwt_auth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Julio Quinteros Pro
2026-02-20 00:31:56 -03:00
co-authored by Claude Sonnet 4.6
parent 0f2516e9cd
commit cde51a53a7
+4
View File
@@ -418,6 +418,7 @@ async def test_team_token_output(prisma_client, audience, monkeypatch):
## 1. INITIAL TEAM CALL - should fail
# use generated key to auth in
setattr(litellm.proxy.proxy_server, "premium_user", True)
setattr(
litellm.proxy.proxy_server,
"general_settings",
@@ -840,6 +841,7 @@ async def test_allowed_routes_admin(
## 1. INITIAL TEAM CALL - should fail
# use generated key to auth in
setattr(litellm.proxy.proxy_server, "premium_user", True)
setattr(
litellm.proxy.proxy_server,
"general_settings",
@@ -1014,6 +1016,7 @@ async def test_allow_access_by_email(
## 1. INITIAL TEAM CALL - should fail
# use generated key to auth in
setattr(litellm.proxy.proxy_server, "premium_user", True)
setattr(
litellm.proxy.proxy_server,
"general_settings",
@@ -1175,6 +1178,7 @@ async def test_end_user_jwt_auth(monkeypatch):
),
)
setattr(litellm.proxy.proxy_server, "premium_user", True)
setattr(
litellm.proxy.proxy_server,
"general_settings",