refactor: shorten model and table prefixes
This commit is contained in:
@@ -28,7 +28,7 @@ func TestPostgresReserveRateLimitIsAtomicAcrossConcurrentConnections(t *testing.
|
||||
user := createAIRateTestUser(t, database, "postgres-rate-"+suffix+"@example.com")
|
||||
action := "postgres_concurrent_" + suffix
|
||||
t.Cleanup(func() {
|
||||
database.Where("user_id = ?", user.ID).Delete(&models.SenlinAgentAIRateBucket{})
|
||||
database.Where("user_id = ?", user.ID).Delete(&models.SaAIRateBucket{})
|
||||
database.Delete(&user)
|
||||
})
|
||||
gateway := NewGatewayWithSecret("system-key", "test-encryption-secret")
|
||||
@@ -66,7 +66,7 @@ func TestPostgresReserveRateLimitIsAtomicAcrossConcurrentConnections(t *testing.
|
||||
}
|
||||
require.Equal(t, limit, allowed)
|
||||
require.Equal(t, attempts-limit, limited)
|
||||
var bucket models.SenlinAgentAIRateBucket
|
||||
var bucket models.SaAIRateBucket
|
||||
require.NoError(t, database.Where("user_id = ? AND action = ?", user.ID, action).First(&bucket).Error)
|
||||
require.Equal(t, limit, bucket.Count)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user