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