From dfda7c10fc772329dde924f5193c017665629f35 Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Wed, 11 Mar 2026 19:45:04 -0700 Subject: [PATCH] fix: set created_by on mock keys in test_list_keys_with_expand_user --- .../proxy/management_endpoints/test_key_management_endpoints.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py index 387986a123d..de7e865fa3a 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py +++ b/tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py @@ -4003,6 +4003,7 @@ async def test_list_keys_with_expand_user(): mock_key1 = MagicMock() mock_key1.token = "token1" mock_key1.user_id = "user123" + mock_key1.created_by = None # Set up model_dump() to raise AttributeError so it falls back to dict() mock_key1.model_dump = MagicMock(side_effect=AttributeError("model_dump not available")) mock_key1.dict = MagicMock(return_value=key1_dict) @@ -4016,6 +4017,7 @@ async def test_list_keys_with_expand_user(): mock_key2 = MagicMock() mock_key2.token = "token2" mock_key2.user_id = "user456" + mock_key2.created_by = None # Set up model_dump() to raise AttributeError so it falls back to dict() mock_key2.model_dump = MagicMock(side_effect=AttributeError("model_dump not available")) mock_key2.dict = MagicMock(return_value=key2_dict)