From 6285f03c365822219758135fde1c880647b019a5 Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Sat, 4 Apr 2026 13:37:11 +0800 Subject: [PATCH] fix: clear TOTP secret in test for proper isolation --- dashboard/backend/tests/unit/test_auth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dashboard/backend/tests/unit/test_auth.py b/dashboard/backend/tests/unit/test_auth.py index 051921d..2f8d7c9 100644 --- a/dashboard/backend/tests/unit/test_auth.py +++ b/dashboard/backend/tests/unit/test_auth.py @@ -204,6 +204,9 @@ class TestTOTP: def test_load_totp_secret_from_env(self, mock_config, temp_auth_file, monkeypatch): """Test loading TOTP secret from environment variable.""" + # Clear any existing secret in file first + save_totp_secret("") + monkeypatch.setenv("TOTP_SECRET", "ENV_SECRET_KEY") import importlib import config