summaryrefslogtreecommitdiffstats
path: root/modules/convert/user_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/convert/user_test.go')
-rw-r--r--modules/convert/user_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/convert/user_test.go b/modules/convert/user_test.go
index fe26456f5d..ce174e3076 100644
--- a/modules/convert/user_test.go
+++ b/modules/convert/user_test.go
@@ -8,7 +8,6 @@ import (
"testing"
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
api "code.gitea.io/gitea/modules/structs"
@@ -18,13 +17,13 @@ import (
func TestUser_ToUser(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
- user1 := db.AssertExistsAndLoadBean(t, &models.User{ID: 1, IsAdmin: true}).(*models.User)
+ user1 := unittest.AssertExistsAndLoadBean(t, &models.User{ID: 1, IsAdmin: true}).(*models.User)
apiUser := toUser(user1, true, true)
assert.True(t, apiUser.IsAdmin)
assert.Contains(t, apiUser.AvatarURL, "://")
- user2 := db.AssertExistsAndLoadBean(t, &models.User{ID: 2, IsAdmin: false}).(*models.User)
+ user2 := unittest.AssertExistsAndLoadBean(t, &models.User{ID: 2, IsAdmin: false}).(*models.User)
apiUser = toUser(user2, true, true)
assert.False(t, apiUser.IsAdmin)
@@ -33,7 +32,7 @@ func TestUser_ToUser(t *testing.T) {
assert.False(t, apiUser.IsAdmin)
assert.EqualValues(t, api.VisibleTypePublic.String(), apiUser.Visibility)
- user31 := db.AssertExistsAndLoadBean(t, &models.User{ID: 31, IsAdmin: false, Visibility: api.VisibleTypePrivate}).(*models.User)
+ user31 := unittest.AssertExistsAndLoadBean(t, &models.User{ID: 31, IsAdmin: false, Visibility: api.VisibleTypePrivate}).(*models.User)
apiUser = toUser(user31, true, true)
assert.False(t, apiUser.IsAdmin)