From 7eaf192967b7eec9598e296f2919c96e4e88d324 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Sun, 19 Feb 2023 17:31:39 +0900 Subject: Rename `GetUnits` to `LoadUnits` (#22970) Same as https://github.com/go-gitea/gitea/pull/22967 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> --- tests/integration/api_team_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/integration') diff --git a/tests/integration/api_team_test.go b/tests/integration/api_team_test.go index 7920513136..2801fdc989 100644 --- a/tests/integration/api_team_test.go +++ b/tests/integration/api_team_test.go @@ -111,7 +111,7 @@ func TestAPITeam(t *testing.T) { // Read team. teamRead := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID}) - assert.NoError(t, teamRead.GetUnits()) + assert.NoError(t, teamRead.LoadUnits(db.DefaultContext)) req = NewRequestf(t, "GET", "/api/v1/teams/%d?token="+token, teamID) resp = MakeRequest(t, req, http.StatusOK) apiTeam = api.Team{} @@ -181,7 +181,7 @@ func TestAPITeam(t *testing.T) { resp = MakeRequest(t, req, http.StatusOK) apiTeam = api.Team{} DecodeJSON(t, resp, &apiTeam) - assert.NoError(t, teamRead.GetUnits()) + assert.NoError(t, teamRead.LoadUnits(db.DefaultContext)) checkTeamResponse(t, "ReadTeam2", &apiTeam, teamRead.Name, *teamToEditDesc.Description, teamRead.IncludesAllRepositories, teamRead.AccessMode.String(), teamRead.GetUnitNames(), teamRead.GetUnitsMap()) @@ -210,7 +210,7 @@ func checkTeamResponse(t *testing.T, testName string, apiTeam *api.Team, name, d func checkTeamBean(t *testing.T, id int64, name, description string, includesAllRepositories bool, permission string, units []string, unitsMap map[string]string) { team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: id}) - assert.NoError(t, team.GetUnits(), "GetUnits") + assert.NoError(t, team.LoadUnits(db.DefaultContext), "LoadUnits") apiTeam, err := convert.ToTeam(db.DefaultContext, team) assert.NoError(t, err) checkTeamResponse(t, fmt.Sprintf("checkTeamBean/%s_%s", name, description), apiTeam, name, description, includesAllRepositories, permission, units, unitsMap) -- cgit v1.2.3