From be84b90aedac1eafa6f09b399c514e1116447e21 Mon Sep 17 00:00:00 2001 From: yucheng Date: Mon, 5 Oct 2026 08:48:21 +0000 Subject: [PATCH] test(proxy): assert pbkdf2 row still verifies when login skips the rehash Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/unit/proxy/auth/test_login_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit/proxy/auth/test_login_utils.py b/tests/unit/proxy/auth/test_login_utils.py index 7b05e5b0c6b..ffafaedbabf 100644 --- a/tests/unit/proxy/auth/test_login_utils.py +++ b/tests/unit/proxy/auth/test_login_utils.py @@ -2386,15 +2386,17 @@ class TestRehashPasswordIfNeeded: @pytest.mark.asyncio async def test_pbkdf2_row_triggers_no_update(self): from litellm.proxy.auth.login_utils import _rehash_password_if_needed - from litellm.proxy.utils import hash_password + from litellm.proxy.utils import hash_password, verify_password + stored = hash_password("rehash-me-1") mock_prisma_client = MagicMock() mock_prisma_client.db.litellm_usertable.update_many = AsyncMock() with patch( # test-quality-ok: the rehash writes to the database; faked so no DB is needed "litellm.proxy.proxy_server.prisma_client", mock_prisma_client ): - await _rehash_password_if_needed("u-1", "rehash-me-1", hash_password("rehash-me-1")) + await _rehash_password_if_needed("u-1", "rehash-me-1", stored) + assert verify_password("rehash-me-1", stored) mock_prisma_client.db.litellm_usertable.update_many.assert_not_called() @pytest.mark.asyncio