Cloudreve/models/migration_test.go

18 lines
267 B
Go
Raw Normal View History

2019-12-04 13:49:28 +08:00
package model
import (
2019-12-05 17:01:14 +08:00
"github.com/jinzhu/gorm"
2019-12-04 13:49:28 +08:00
"github.com/stretchr/testify/assert"
"testing"
)
func TestMigration(t *testing.T) {
asserts := assert.New(t)
2019-12-05 17:01:14 +08:00
DB, _ = gorm.Open("sqlite3", ":memory:")
2019-12-04 13:49:28 +08:00
asserts.NotPanics(func() {
migration()
})
2019-12-05 17:01:14 +08:00
DB = mockDB
2019-12-04 13:49:28 +08:00
}