mirror of
https://github.com/go-gitea/gitea
synced 2025-07-12 13:37:20 +00:00
Introduce OrgList and add LoadTeams, optimaze Load teams for orgs (#32543)
This commit is contained in:
@ -60,3 +60,14 @@ func TestGetUserOrgsList(t *testing.T) {
|
||||
assert.EqualValues(t, 2, orgs[0].NumRepos)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadOrgListTeams(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
orgs, err := organization.GetUserOrgsList(db.DefaultContext, &user_model.User{ID: 4})
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, orgs, 1)
|
||||
teamsMap, err := organization.OrgList(orgs).LoadTeams(db.DefaultContext)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, teamsMap, 1)
|
||||
assert.Len(t, teamsMap[3], 5)
|
||||
}
|
||||
|
Reference in New Issue
Block a user