summaryrefslogtreecommitdiffstats
path: root/routers/web/admin/users_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/admin/users_test.go')
-rw-r--r--routers/web/admin/users_test.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/routers/web/admin/users_test.go b/routers/web/admin/users_test.go
index 3d0b11a774..022d8f662c 100644
--- a/routers/web/admin/users_test.go
+++ b/routers/web/admin/users_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/test"
@@ -19,10 +20,10 @@ import (
func TestNewUserPost_MustChangePassword(t *testing.T) {
- models.PrepareTestEnv(t)
+ db.PrepareTestEnv(t)
ctx := test.MockContext(t, "admin/users/new")
- u := models.AssertExistsAndLoadBean(t, &models.User{
+ u := db.AssertExistsAndLoadBean(t, &models.User{
IsAdmin: true,
ID: 2,
}).(*models.User)
@@ -56,10 +57,10 @@ func TestNewUserPost_MustChangePassword(t *testing.T) {
}
func TestNewUserPost_MustChangePasswordFalse(t *testing.T) {
- models.PrepareTestEnv(t)
+ db.PrepareTestEnv(t)
ctx := test.MockContext(t, "admin/users/new")
- u := models.AssertExistsAndLoadBean(t, &models.User{
+ u := db.AssertExistsAndLoadBean(t, &models.User{
IsAdmin: true,
ID: 2,
}).(*models.User)
@@ -93,10 +94,10 @@ func TestNewUserPost_MustChangePasswordFalse(t *testing.T) {
}
func TestNewUserPost_InvalidEmail(t *testing.T) {
- models.PrepareTestEnv(t)
+ db.PrepareTestEnv(t)
ctx := test.MockContext(t, "admin/users/new")
- u := models.AssertExistsAndLoadBean(t, &models.User{
+ u := db.AssertExistsAndLoadBean(t, &models.User{
IsAdmin: true,
ID: 2,
}).(*models.User)
@@ -123,10 +124,10 @@ func TestNewUserPost_InvalidEmail(t *testing.T) {
}
func TestNewUserPost_VisibilityDefaultPublic(t *testing.T) {
- models.PrepareTestEnv(t)
+ db.PrepareTestEnv(t)
ctx := test.MockContext(t, "admin/users/new")
- u := models.AssertExistsAndLoadBean(t, &models.User{
+ u := db.AssertExistsAndLoadBean(t, &models.User{
IsAdmin: true,
ID: 2,
}).(*models.User)
@@ -161,10 +162,10 @@ func TestNewUserPost_VisibilityDefaultPublic(t *testing.T) {
}
func TestNewUserPost_VisibilityPrivate(t *testing.T) {
- models.PrepareTestEnv(t)
+ db.PrepareTestEnv(t)
ctx := test.MockContext(t, "admin/users/new")
- u := models.AssertExistsAndLoadBean(t, &models.User{
+ u := db.AssertExistsAndLoadBean(t, &models.User{
IsAdmin: true,
ID: 2,
}).(*models.User)