summaryrefslogtreecommitdiffstats
path: root/modules/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'modules/migrations')
-rw-r--r--modules/migrations/gitea_uploader_test.go3
-rw-r--r--modules/migrations/main_test.go4
-rw-r--r--modules/migrations/migrate_test.go3
3 files changed, 6 insertions, 4 deletions
diff --git a/modules/migrations/gitea_uploader_test.go b/modules/migrations/gitea_uploader_test.go
index b8b947961f..b5763f30d9 100644
--- a/modules/migrations/gitea_uploader_test.go
+++ b/modules/migrations/gitea_uploader_test.go
@@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/migrations/base"
"code.gitea.io/gitea/modules/structs"
@@ -24,7 +25,7 @@ func TestGiteaUploadRepo(t *testing.T) {
// FIXME: Since no accesskey or user/password will trigger rate limit of github, just skip
t.Skip()
- db.PrepareTestEnv(t)
+ unittest.PrepareTestEnv(t)
user := db.AssertExistsAndLoadBean(t, &models.User{ID: 1}).(*models.User)
diff --git a/modules/migrations/main_test.go b/modules/migrations/main_test.go
index 5b29230659..e9108c3c93 100644
--- a/modules/migrations/main_test.go
+++ b/modules/migrations/main_test.go
@@ -10,14 +10,14 @@ import (
"testing"
"time"
- "code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/migrations/base"
"github.com/stretchr/testify/assert"
)
func TestMain(m *testing.M) {
- db.MainTest(m, filepath.Join("..", ".."))
+ unittest.MainTest(m, filepath.Join("..", ".."))
}
func timePtr(t time.Time) *time.Time {
diff --git a/modules/migrations/migrate_test.go b/modules/migrations/migrate_test.go
index c050a9abc0..aecc263cc6 100644
--- a/modules/migrations/migrate_test.go
+++ b/modules/migrations/migrate_test.go
@@ -10,13 +10,14 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/setting"
"github.com/stretchr/testify/assert"
)
func TestMigrateWhiteBlocklist(t *testing.T) {
- assert.NoError(t, db.PrepareTestDatabase())
+ assert.NoError(t, unittest.PrepareTestDatabase())
adminUser := db.AssertExistsAndLoadBean(t, &models.User{Name: "user1"}).(*models.User)
nonAdminUser := db.AssertExistsAndLoadBean(t, &models.User{Name: "user2"}).(*models.User)