delete handler test
This commit is contained in:
12
db/db.go
12
db/db.go
@@ -2,7 +2,6 @@ package db
|
||||
|
||||
import (
|
||||
"log"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
@@ -21,14 +20,3 @@ func New() *gorm.DB {
|
||||
}
|
||||
return db
|
||||
}
|
||||
|
||||
// New creates a new GORM connection to the mock database
|
||||
func NewMock() *gorm.DB {
|
||||
// projectRoot presumes this file is `<root>/db/db.go`
|
||||
dbPath, _ := filepath.Abs(filepath.Join(cFile, "../../test_data/mock.db"))
|
||||
db, err := gorm.Open("sqlite3", dbPath)
|
||||
if err != nil {
|
||||
log.Printf("when opening mock database: %v\n", err)
|
||||
}
|
||||
return db
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user