This commit is contained in:
ryan
2026-06-19 14:09:42 +08:00
parent 8506a03f1c
commit 19d476ed7f
338 changed files with 17810 additions and 1844 deletions
@@ -104,11 +104,11 @@ func TestMigrateClearsStaleSystemConfigCache(t *testing.T) {
})
staleConfig := model.SystemConfig{
Key: model.ConfigKeyCapLoginEnabled,
Key: model.ConfigKeyEmailLoginVerificationEnabled,
Value: "true",
Type: "system",
}
if err := db.HSetJSON(context.Background(), repository.SystemConfigRedisHashKey, model.ConfigKeyCapLoginEnabled, &staleConfig); err != nil {
if err := db.HSetJSON(context.Background(), repository.SystemConfigRedisHashKey, model.ConfigKeyEmailLoginVerificationEnabled, &staleConfig); err != nil {
t.Fatalf("HSetJSON() error = %v", err)
}
@@ -122,11 +122,11 @@ func TestMigrateClearsStaleSystemConfigCache(t *testing.T) {
t.Fatalf("system config cache exists = %d, want 0", exists)
}
enabled, err := repository.GetBoolByKey(context.Background(), model.ConfigKeyCapLoginEnabled)
enabled, err := repository.GetBoolByKey(context.Background(), model.ConfigKeyEmailLoginVerificationEnabled)
if err != nil {
t.Fatalf("GetBoolByKey(%s) error = %v", model.ConfigKeyCapLoginEnabled, err)
t.Fatalf("GetBoolByKey(%s) error = %v", model.ConfigKeyEmailLoginVerificationEnabled, err)
}
if enabled {
t.Fatalf("GetBoolByKey(%s) = true, want false", model.ConfigKeyCapLoginEnabled)
t.Fatalf("GetBoolByKey(%s) = true, want false", model.ConfigKeyEmailLoginVerificationEnabled)
}
}