Skip to content

Commit 9981109

Browse files
committed
Fix test
1 parent d4a502c commit 9981109

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

models/db/engine_test.go renamed to models/engine_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package db
5+
package models
66

77
import (
88
"io/ioutil"
99
"os"
1010
"path/filepath"
1111
"testing"
1212

13+
"code.gitea.io/gitea/models/db"
1314
"code.gitea.io/gitea/modules/setting"
1415

1516
"github.com/stretchr/testify/assert"
1617
)
1718

1819
func TestDumpDatabase(t *testing.T) {
19-
assert.NoError(t, PrepareTestDatabase())
20+
assert.NoError(t, db.PrepareTestDatabase())
2021

2122
dir, err := ioutil.TempDir(os.TempDir(), "dump")
2223
assert.NoError(t, err)
@@ -25,10 +26,10 @@ func TestDumpDatabase(t *testing.T) {
2526
ID int64 `xorm:"pk autoincr"`
2627
Version int64
2728
}
28-
assert.NoError(t, x.Sync2(new(Version)))
29+
assert.NoError(t, db.DefaultContext().Engine().Sync2(new(Version)))
2930

3031
for _, dbName := range setting.SupportedDatabases {
3132
dbType := setting.GetDBTypeByName(dbName)
32-
assert.NoError(t, DumpDatabase(filepath.Join(dir, dbType+".sql"), dbType))
33+
assert.NoError(t, db.DumpDatabase(filepath.Join(dir, dbType+".sql"), dbType))
3334
}
3435
}

0 commit comments

Comments
 (0)