From 20146213ce4191b13cc5aac8d7096e91e10f42a4 Mon Sep 17 00:00:00 2001 From: jesus Date: Fri, 18 Sep 2026 22:45:35 +0000 Subject: [PATCH] test(proxy): expect object_permission include in fuzzy user lookups Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/proxy_unit_tests/test_auth_checks.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/proxy_unit_tests/test_auth_checks.py b/tests/proxy_unit_tests/test_auth_checks.py index 2538556d3b5..769b2f64d02 100644 --- a/tests/proxy_unit_tests/test_auth_checks.py +++ b/tests/proxy_unit_tests/test_auth_checks.py @@ -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}, )