File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a MIT-style
3
3
// license that can be found in the LICENSE file.
4
4
5
- package db
5
+ package models
6
6
7
7
import (
8
8
"io/ioutil"
9
9
"os"
10
10
"path/filepath"
11
11
"testing"
12
12
13
+ "code.gitea.io/gitea/models/db"
13
14
"code.gitea.io/gitea/modules/setting"
14
15
15
16
"github.com/stretchr/testify/assert"
16
17
)
17
18
18
19
func TestDumpDatabase (t * testing.T ) {
19
- assert .NoError (t , PrepareTestDatabase ())
20
+ assert .NoError (t , db . PrepareTestDatabase ())
20
21
21
22
dir , err := ioutil .TempDir (os .TempDir (), "dump" )
22
23
assert .NoError (t , err )
@@ -25,10 +26,10 @@ func TestDumpDatabase(t *testing.T) {
25
26
ID int64 `xorm:"pk autoincr"`
26
27
Version int64
27
28
}
28
- assert .NoError (t , x .Sync2 (new (Version )))
29
+ assert .NoError (t , db . DefaultContext (). Engine () .Sync2 (new (Version )))
29
30
30
31
for _ , dbName := range setting .SupportedDatabases {
31
32
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 ))
33
34
}
34
35
}
You can’t perform that action at this time.
0 commit comments