diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-05-20 22:08:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 22:08:52 +0800 |
commit | fd7d83ace60258acf7139c4c787aa8af75b7ba8c (patch) | |
tree | 50038348ec10485f72344f3ac80324e04abc1283 /models/organization/team_test.go | |
parent | d81e31ad7826a81fc7139f329f250594610a274b (diff) | |
download | gitea-fd7d83ace60258acf7139c4c787aa8af75b7ba8c.tar.gz gitea-fd7d83ace60258acf7139c4c787aa8af75b7ba8c.zip |
Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context
* remove some unnecessary wrap functions
Diffstat (limited to 'models/organization/team_test.go')
-rw-r--r-- | models/organization/team_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/models/organization/team_test.go b/models/organization/team_test.go index bbf9f789f6..860a7107ec 100644 --- a/models/organization/team_test.go +++ b/models/organization/team_test.go @@ -71,7 +71,7 @@ func TestGetTeam(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) testSuccess := func(orgID int64, name string) { - team, err := GetTeam(orgID, name) + team, err := GetTeam(db.DefaultContext, orgID, name) assert.NoError(t, err) assert.EqualValues(t, orgID, team.OrgID) assert.Equal(t, name, team.Name) @@ -79,9 +79,9 @@ func TestGetTeam(t *testing.T) { testSuccess(3, "Owners") testSuccess(3, "team1") - _, err := GetTeam(3, "nonexistent") + _, err := GetTeam(db.DefaultContext, 3, "nonexistent") assert.Error(t, err) - _, err = GetTeam(unittest.NonexistentID, "Owners") + _, err = GetTeam(db.DefaultContext, unittest.NonexistentID, "Owners") assert.Error(t, err) } @@ -89,7 +89,7 @@ func TestGetTeamByID(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) testSuccess := func(teamID int64) { - team, err := GetTeamByID(teamID) + team, err := GetTeamByID(db.DefaultContext, teamID) assert.NoError(t, err) assert.EqualValues(t, teamID, team.ID) } @@ -98,7 +98,7 @@ func TestGetTeamByID(t *testing.T) { testSuccess(3) testSuccess(4) - _, err := GetTeamByID(unittest.NonexistentID) + _, err := GetTeamByID(db.DefaultContext, unittest.NonexistentID) assert.Error(t, err) } |