Skip to content

Commit 6e1606e

Browse files
committed
fix tests
1 parent 0618b95 commit 6e1606e

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

Diff for: services/org/team_test.go

-18
Original file line numberDiff line numberDiff line change
@@ -166,24 +166,6 @@ func TestRemoveTeamMember(t *testing.T) {
166166
assert.True(t, organization.IsErrLastOrgOwner(err))
167167
}
168168

169-
func TestRepository_RecalculateAccesses3(t *testing.T) {
170-
assert.NoError(t, unittest.PrepareTestDatabase())
171-
team5 := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: 5})
172-
user29 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 29})
173-
174-
has, err := db.GetEngine(db.DefaultContext).Get(&access_model.Access{UserID: user29.ID, RepoID: 23})
175-
assert.NoError(t, err)
176-
assert.False(t, has)
177-
178-
// adding user29 to team5 should add an explicit access row for repo 23
179-
// even though repo 23 is public
180-
assert.NoError(t, AddTeamMember(db.DefaultContext, team5, user29))
181-
182-
has, err = db.GetEngine(db.DefaultContext).Get(&access_model.Access{UserID: user29.ID, RepoID: 23})
183-
assert.NoError(t, err)
184-
assert.True(t, has)
185-
}
186-
187169
func TestIncludesAllRepositoriesTeams(t *testing.T) {
188170
assert.NoError(t, unittest.PrepareTestDatabase())
189171

Diff for: tests/integration/api_team_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ func TestAPITeam(t *testing.T) {
7878
apiTeam = api.Team{}
7979
DecodeJSON(t, resp, &apiTeam)
8080
checkTeamResponse(t, "CreateTeam1", &apiTeam, teamToCreate.Name, teamToCreate.Description, teamToCreate.IncludesAllRepositories,
81-
teamToCreate.Permission, teamToCreate.Units, nil)
81+
"none", teamToCreate.Units, nil)
8282
checkTeamBean(t, apiTeam.ID, teamToCreate.Name, teamToCreate.Description, teamToCreate.IncludesAllRepositories,
83-
teamToCreate.Permission, teamToCreate.Units, nil)
83+
"none", teamToCreate.Units, nil)
8484
teamID := apiTeam.ID
8585

8686
// Edit team.
@@ -149,9 +149,9 @@ func TestAPITeam(t *testing.T) {
149149
apiTeam = api.Team{}
150150
DecodeJSON(t, resp, &apiTeam)
151151
checkTeamResponse(t, "CreateTeam2", &apiTeam, teamToCreate.Name, teamToCreate.Description, teamToCreate.IncludesAllRepositories,
152-
"read", nil, teamToCreate.UnitsMap)
152+
"none", nil, teamToCreate.UnitsMap)
153153
checkTeamBean(t, apiTeam.ID, teamToCreate.Name, teamToCreate.Description, teamToCreate.IncludesAllRepositories,
154-
"read", nil, teamToCreate.UnitsMap)
154+
"none", nil, teamToCreate.UnitsMap)
155155
teamID = apiTeam.ID
156156

157157
// Edit team.
@@ -171,9 +171,9 @@ func TestAPITeam(t *testing.T) {
171171
apiTeam = api.Team{}
172172
DecodeJSON(t, resp, &apiTeam)
173173
checkTeamResponse(t, "EditTeam2", &apiTeam, teamToEdit.Name, *teamToEdit.Description, *teamToEdit.IncludesAllRepositories,
174-
"read", nil, teamToEdit.UnitsMap)
174+
"none", nil, teamToEdit.UnitsMap)
175175
checkTeamBean(t, apiTeam.ID, teamToEdit.Name, *teamToEdit.Description, *teamToEdit.IncludesAllRepositories,
176-
"read", nil, teamToEdit.UnitsMap)
176+
"none", nil, teamToEdit.UnitsMap)
177177

178178
// Edit team Description only
179179
editDescription = "second team"

Diff for: tests/integration/org_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ func TestOrgRestrictedUser(t *testing.T) {
177177
resp := adminSession.MakeRequest(t, req, http.StatusCreated)
178178
DecodeJSON(t, resp, &apiTeam)
179179
checkTeamResponse(t, "CreateTeam_codereader", &apiTeam, teamToCreate.Name, teamToCreate.Description, teamToCreate.IncludesAllRepositories,
180-
teamToCreate.Permission, teamToCreate.Units, nil)
180+
"none", teamToCreate.Units, nil)
181181
checkTeamBean(t, apiTeam.ID, teamToCreate.Name, teamToCreate.Description, teamToCreate.IncludesAllRepositories,
182-
teamToCreate.Permission, teamToCreate.Units, nil)
182+
"none", teamToCreate.Units, nil)
183183
// teamID := apiTeam.ID
184184

185185
// Now we need to add the restricted user to the team

0 commit comments

Comments
 (0)