mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 05:57:20 +00:00
refactor some functions to support ctx as first parameter (#21878)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
@ -25,7 +25,7 @@ func TestIncludesAllRepositoriesTeams(t *testing.T) {
|
||||
|
||||
testTeamRepositories := func(teamID int64, repoIds []int64) {
|
||||
team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID})
|
||||
assert.NoError(t, team.GetRepositoriesCtx(db.DefaultContext), "%s: GetRepositories", team.Name)
|
||||
assert.NoError(t, team.LoadRepositories(db.DefaultContext), "%s: GetRepositories", team.Name)
|
||||
assert.Len(t, team.Repos, team.NumRepos, "%s: len repo", team.Name)
|
||||
assert.Len(t, team.Repos, len(repoIds), "%s: repo count", team.Name)
|
||||
for i, rid := range repoIds {
|
||||
@ -36,7 +36,7 @@ func TestIncludesAllRepositoriesTeams(t *testing.T) {
|
||||
}
|
||||
|
||||
// Get an admin user.
|
||||
user, err := user_model.GetUserByID(1)
|
||||
user, err := user_model.GetUserByID(db.DefaultContext, 1)
|
||||
assert.NoError(t, err, "GetUserByID")
|
||||
|
||||
// Create org.
|
||||
@ -153,7 +153,7 @@ func TestUpdateRepositoryVisibilityChanged(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
|
||||
// Get sample repo and change visibility
|
||||
repo, err := repo_model.GetRepositoryByID(9)
|
||||
repo, err := repo_model.GetRepositoryByID(db.DefaultContext, 9)
|
||||
assert.NoError(t, err)
|
||||
repo.IsPrivate = true
|
||||
|
||||
|
Reference in New Issue
Block a user