diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-24 17:49:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 17:49:20 +0800 |
commit | a666829a37be6f9fd98f9e7dd1767c420f7f3b32 (patch) | |
tree | 9ab1434b759a8a2cb275a83149903a823851e309 /models/access_test.go | |
parent | 4e7ca946da2a2642a62f114825129bf5d7ed9196 (diff) | |
download | gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.tar.gz gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.zip |
Move user related model into models/user (#17781)
* Move user related model into models/user
* Fix lint for windows
* Fix windows lint
* Fix windows lint
* Move some tests in models
* Merge
Diffstat (limited to 'models/access_test.go')
-rw-r--r-- | models/access_test.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/models/access_test.go b/models/access_test.go index 81e36ed2e0..a2fd05a033 100644 --- a/models/access_test.go +++ b/models/access_test.go @@ -9,6 +9,7 @@ import ( "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" + user_model "code.gitea.io/gitea/models/user" "github.com/stretchr/testify/assert" ) @@ -16,9 +17,9 @@ import ( func TestAccessLevel(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - user2 := unittest.AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) - user5 := unittest.AssertExistsAndLoadBean(t, &User{ID: 5}).(*User) - user29 := unittest.AssertExistsAndLoadBean(t, &User{ID: 29}).(*User) + user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User) + user5 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 5}).(*user_model.User) + user29 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 29}).(*user_model.User) // A public repository owned by User 2 repo1 := unittest.AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository) assert.False(t, repo1.IsPrivate) @@ -67,8 +68,8 @@ func TestAccessLevel(t *testing.T) { func TestHasAccess(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - user1 := unittest.AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) - user2 := unittest.AssertExistsAndLoadBean(t, &User{ID: 5}).(*User) + user1 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User) + user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 5}).(*user_model.User) // A public repository owned by User 2 repo1 := unittest.AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository) assert.False(t, repo1.IsPrivate) @@ -125,7 +126,7 @@ func TestRepository_RecalculateAccesses2(t *testing.T) { func TestRepository_RecalculateAccesses3(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) team5 := unittest.AssertExistsAndLoadBean(t, &Team{ID: 5}).(*Team) - user29 := unittest.AssertExistsAndLoadBean(t, &User{ID: 29}).(*User) + user29 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 29}).(*user_model.User) has, err := db.GetEngine(db.DefaultContext).Get(&Access{UserID: 29, RepoID: 23}) assert.NoError(t, err) |