aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoryp053272023-02-19 17:31:39 +0900
committerGitHub2023-02-19 16:31:39 +0800
commit7eaf192967b7eec9598e296f2919c96e4e88d324 (patch)
treee1a574498eb290bf5766f86f25da85adaa5286a2 /tests
parent61b89747ed54e17ab5c7730adbad1c5d4d5ff78a (diff)
Rename `GetUnits` to `LoadUnits` (#22970)
Same as https://github.com/go-gitea/gitea/pull/22967 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/api_team_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/integration/api_team_test.go b/tests/integration/api_team_test.go
index 792051313..2801fdc98 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)