test(proxy): expect object_permission include in fuzzy user lookups

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
jesus 2026-09-18 22:45:35 +00:00
parent 90263e93c5
commit 20146213ce

View file

@ -845,7 +845,8 @@ async def test_get_fuzzy_user_object():
)
assert result == test_user
mock_prisma.db.litellm_usertable.find_unique.assert_called_with(
where={"sso_user_id": "sso_123"}, include={"organization_memberships": True}
where={"sso_user_id": "sso_123"},
include={"organization_memberships": True, "object_permission": True},
)
# Test 2: SSO ID not found, find by email
@ -861,7 +862,7 @@ async def test_get_fuzzy_user_object():
assert result == test_user
mock_prisma.db.litellm_usertable.find_first.assert_called_with(
where={"user_email": {"equals": "test@example.com", "mode": "insensitive"}},
include={"organization_memberships": True},
include={"organization_memberships": True, "object_permission": True},
)
# Test 3: Verify background SSO update task when user found by email
@ -889,7 +890,7 @@ async def test_get_fuzzy_user_object():
assert result == test_user
mock_prisma.db.litellm_usertable.find_first.assert_called_with(
where={"user_email": {"equals": "test@example.com", "mode": "insensitive"}},
include={"organization_memberships": True},
include={"organization_memberships": True, "object_permission": True},
)
# Test 6: Only SSO ID provided (no email)
@ -899,7 +900,8 @@ async def test_get_fuzzy_user_object():
)
assert result == test_user
mock_prisma.db.litellm_usertable.find_unique.assert_called_with(
where={"sso_user_id": "sso_123"}, include={"organization_memberships": True}
where={"sso_user_id": "sso_123"},
include={"organization_memberships": True, "object_permission": True},
)