diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-10-08 10:57:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-08 10:57:41 +0800 |
commit | 78438d310be42f9c5e0e2937ee54e6050cc8f381 (patch) | |
tree | 235c28d5bd22d38dcf70dd5d4eb8c412f66899ac /models/user_test.go | |
parent | 1a269f7ef81b1a7865c4679b91a4037059ad4938 (diff) | |
download | gitea-78438d310be42f9c5e0e2937ee54e6050cc8f381.tar.gz gitea-78438d310be42f9c5e0e2937ee54e6050cc8f381.zip |
Fix issues/pr list broken when there are many repositories (#8409)
* fix issues/pr list broken when there are many repositories
* remove unused codes
* fix counting error on issues/prs
* keep the old logic
* fix panic
* fix tests
Diffstat (limited to 'models/user_test.go')
-rw-r--r-- | models/user_test.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/models/user_test.go b/models/user_test.go index bcb955817c..75d806eadc 100644 --- a/models/user_test.go +++ b/models/user_test.go @@ -275,28 +275,6 @@ func BenchmarkHashPassword(b *testing.B) { } } -func TestGetOrgRepositoryIDs(t *testing.T) { - assert.NoError(t, PrepareTestDatabase()) - user2 := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) - user4 := AssertExistsAndLoadBean(t, &User{ID: 4}).(*User) - user5 := AssertExistsAndLoadBean(t, &User{ID: 5}).(*User) - - accessibleRepos, err := user2.GetOrgRepositoryIDs() - assert.NoError(t, err) - // User 2's team has access to private repos 3, 5, repo 32 is a public repo of the organization - assert.Equal(t, []int64{3, 5, 23, 24, 32}, accessibleRepos) - - accessibleRepos, err = user4.GetOrgRepositoryIDs() - assert.NoError(t, err) - // User 4's team has access to private repo 3, repo 32 is a public repo of the organization - assert.Equal(t, []int64{3, 32}, accessibleRepos) - - accessibleRepos, err = user5.GetOrgRepositoryIDs() - assert.NoError(t, err) - // User 5's team has no access to any repo - assert.Len(t, accessibleRepos, 0) -} - func TestNewGitSig(t *testing.T) { users := make([]*User, 0, 20) sess := x.NewSession() |