fix: ensure test isolation for password hash env var test
Deploy Dashboard (Dev) / deploy-dev (push) Failing after 4m44s
Run Tests / Frontend Tests (push) Has been cancelled
Run Tests / Test Summary (push) Has been cancelled
Run Tests / Backend Tests (push) Has started running

Clear password_hash in file before testing env var fallback.
This commit is contained in:
Gan, Jimmy
2026-04-04 18:17:50 +08:00
parent c296a8e50a
commit de219a388a
@@ -278,6 +278,14 @@ class TestPasswordPersistence:
def test_load_password_hash_from_env(self, mock_config, temp_auth_file):
"""Test loading password hash from environment variable."""
# Clear any hash in the file first
import json
with open(temp_auth_file, 'r') as f:
data = json.load(f)
data['password_hash'] = ""
with open(temp_auth_file, 'w') as f:
json.dump(data, f)
# When no hash in file, should return env var
loaded = load_password_hash()
assert loaded == mock_config.ADMIN_PASSWORD_HASH