Add test postgres db connection

This commit is contained in:
2025-03-06 19:23:24 +01:00
parent 4766a166df
commit 629baa9952
8 changed files with 77 additions and 13 deletions

View File

@@ -140,7 +140,7 @@ func TestStructTagsToFields(t *testing.T) {
// TestStructQueries tests the struct-based query methods using the test database
func TestStructQueries(t *testing.T) {
// Setup test database
database, err := db.NewTestDB(&mockSecrets{})
database, err := db.NewTestSQLiteDB(&mockSecrets{})
if err != nil {
t.Fatalf("Failed to create test database: %v", err)
}
@@ -356,7 +356,7 @@ func TestStructQueries(t *testing.T) {
// TestScanStructsErrors tests error handling for ScanStructs
func TestScanStructsErrors(t *testing.T) {
database, err := db.NewTestDB(&mockSecrets{})
database, err := db.NewTestSQLiteDB(&mockSecrets{})
if err != nil {
t.Fatalf("Failed to create test database: %v", err)
}
@@ -421,7 +421,7 @@ func TestScanStructsErrors(t *testing.T) {
// TestEncryptedFields tests handling of encrypted fields
func TestEncryptedFields(t *testing.T) {
database, err := db.NewTestDB(&mockSecrets{})
database, err := db.NewTestSQLiteDB(&mockSecrets{})
if err != nil {
t.Fatalf("Failed to create test database: %v", err)
}