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}, )