diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-22 23:21:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-22 23:21:55 +0800 |
commit | baed01f24753afb600a2984dcb9bcda0bb8502b6 (patch) | |
tree | 5621ef980b6b0067a21c86be7e4808d83c0538ab /models/access_test.go | |
parent | c2ab19888f92fbdec4276a16d224e8de80d1d1dd (diff) | |
download | gitea-baed01f24753afb600a2984dcb9bcda0bb8502b6.tar.gz gitea-baed01f24753afb600a2984dcb9bcda0bb8502b6.zip |
Remove unnecessary attributes of User struct (#17745)
* Remove unnecessary functions of User struct
* Move more database methods out of user struct
* Move more database methods out of user struct
* Fix template failure
* Fix bug
* Remove finished FIXME
* remove unnecessary code
Diffstat (limited to 'models/access_test.go')
-rw-r--r-- | models/access_test.go | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/models/access_test.go b/models/access_test.go index 942ca4af42..81e36ed2e0 100644 --- a/models/access_test.go +++ b/models/access_test.go @@ -90,39 +90,6 @@ func TestHasAccess(t *testing.T) { assert.NoError(t, err) } -func TestUser_GetRepositoryAccesses(t *testing.T) { - assert.NoError(t, unittest.PrepareTestDatabase()) - - user1 := unittest.AssertExistsAndLoadBean(t, &User{ID: 1}).(*User) - accesses, err := user1.GetRepositoryAccesses() - assert.NoError(t, err) - assert.Len(t, accesses, 0) - - user29 := unittest.AssertExistsAndLoadBean(t, &User{ID: 29}).(*User) - accesses, err = user29.GetRepositoryAccesses() - assert.NoError(t, err) - assert.Len(t, accesses, 2) -} - -func TestUser_GetAccessibleRepositories(t *testing.T) { - assert.NoError(t, unittest.PrepareTestDatabase()) - - user1 := unittest.AssertExistsAndLoadBean(t, &User{ID: 1}).(*User) - repos, err := user1.GetAccessibleRepositories(0) - assert.NoError(t, err) - assert.Len(t, repos, 0) - - user2 := unittest.AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) - repos, err = user2.GetAccessibleRepositories(0) - assert.NoError(t, err) - assert.Len(t, repos, 4) - - user29 := unittest.AssertExistsAndLoadBean(t, &User{ID: 29}).(*User) - repos, err = user29.GetAccessibleRepositories(0) - assert.NoError(t, err) - assert.Len(t, repos, 2) -} - func TestRepository_RecalculateAccesses(t *testing.T) { // test with organization repo assert.NoError(t, unittest.PrepareTestDatabase()) |