From 83fc231c75c8ce0746d908fca888bd65c15f2a70 Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Sat, 4 Apr 2026 13:47:05 +0800 Subject: [PATCH] fix: clear TOTP secret in test_verify_totp_no_secret_enabled for test isolation --- dashboard/backend/tests/unit/test_auth.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dashboard/backend/tests/unit/test_auth.py b/dashboard/backend/tests/unit/test_auth.py index 2f8d7c9..f4b59ec 100644 --- a/dashboard/backend/tests/unit/test_auth.py +++ b/dashboard/backend/tests/unit/test_auth.py @@ -232,6 +232,8 @@ class TestTOTP: def test_verify_totp_no_secret_enabled(self, mock_config, temp_auth_file): """Test that TOTP verification passes when 2FA not enabled.""" + # Clear any existing secret from previous tests + save_totp_secret("") # No secret saved, should return True (2FA disabled) assert verify_totp("any_code")