Fix: uint may overflow / Test: get user storage

This commit is contained in:
HFO4
2019-12-07 15:05:48 +08:00
parent 9386371097
commit f4c414c0f6
11 changed files with 126 additions and 61 deletions

View File

@@ -1,6 +1,7 @@
package model
import (
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
"testing"
@@ -8,10 +9,12 @@ import (
func TestMigration(t *testing.T) {
asserts := assert.New(t)
conf.DatabaseConfig.Type = "sqlite3"
DB, _ = gorm.Open("sqlite3", ":memory:")
asserts.NotPanics(func() {
migration()
})
conf.DatabaseConfig.Type = "mysql"
DB = mockDB
}