Skip to content

Commit ca73f6c

Browse files
committed
Fix project test to recover the changes of global variable
1 parent 94ea1be commit ca73f6c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/integration/org_project_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ import (
1414
func TestOrgProjectAccess(t *testing.T) {
1515
defer tests.PrepareTestEnv(t)()
1616

17+
oldDisabledRepoUnits := unit_model.DisabledRepoUnits
1718
// disable repo project unit
1819
unit_model.DisabledRepoUnits = []unit_model.Type{unit_model.TypeProjects}
20+
defer func() {
21+
unit_model.DisabledRepoUnits = oldDisabledRepoUnits
22+
}()
1923

2024
// repo project, 404
2125
req := NewRequest(t, "GET", "/user2/repo1/projects")

0 commit comments

Comments
 (0)