diff options
Diffstat (limited to 'modules/convert/user_test.go')
-rw-r--r-- | modules/convert/user_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/convert/user_test.go b/modules/convert/user_test.go index 679c4f9894..404adc2029 100644 --- a/modules/convert/user_test.go +++ b/modules/convert/user_test.go @@ -8,20 +8,21 @@ import ( "testing" "code.gitea.io/gitea/models" + "code.gitea.io/gitea/models/db" api "code.gitea.io/gitea/modules/structs" "github.com/stretchr/testify/assert" ) func TestUser_ToUser(t *testing.T) { - assert.NoError(t, models.PrepareTestDatabase()) + assert.NoError(t, db.PrepareTestDatabase()) - user1 := models.AssertExistsAndLoadBean(t, &models.User{ID: 1, IsAdmin: true}).(*models.User) + user1 := db.AssertExistsAndLoadBean(t, &models.User{ID: 1, IsAdmin: true}).(*models.User) apiUser := toUser(user1, true, true) assert.True(t, apiUser.IsAdmin) - user2 := models.AssertExistsAndLoadBean(t, &models.User{ID: 2, IsAdmin: false}).(*models.User) + user2 := db.AssertExistsAndLoadBean(t, &models.User{ID: 2, IsAdmin: false}).(*models.User) apiUser = toUser(user2, true, true) assert.False(t, apiUser.IsAdmin) @@ -30,7 +31,7 @@ func TestUser_ToUser(t *testing.T) { assert.False(t, apiUser.IsAdmin) assert.EqualValues(t, api.VisibleTypePublic.String(), apiUser.Visibility) - user31 := models.AssertExistsAndLoadBean(t, &models.User{ID: 31, IsAdmin: false, Visibility: api.VisibleTypePrivate}).(*models.User) + user31 := db.AssertExistsAndLoadBean(t, &models.User{ID: 31, IsAdmin: false, Visibility: api.VisibleTypePrivate}).(*models.User) apiUser = toUser(user31, true, true) assert.False(t, apiUser.IsAdmin) |