Added some db unit tests

This commit is contained in:
Jamie Curnow committed 2023-07-26 13:29:12 +10:00
1 parent d555af68fe
commit e4e70ae6be
7 files changed
+198 -55

No files matched your search

+6
View File
@@ -37,6 +37,12 @@ func GetDB() *gorm.DB {
return dbInstance
}
// SetDB will set the dbOnstance to this
// Used by unit testing to set the db to a mock database
func SetDB(db *gorm.DB) {
dbInstance = db
}
func connect() (*gorm.DB, error) {
var d gorm.Dialector
dsn := config.Configuration.DB.GetGormConnectURL()