Fix project test to recover the changes of global variable

This commit is contained in:
Lunny Xiao 2024-05-05 15:29:54 +08:00
parent 94ea1bed2a
commit ca73f6c78e
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 4 additions and 0 deletions

View File

@ -14,8 +14,12 @@ import (
func TestOrgProjectAccess(t *testing.T) {
defer tests.PrepareTestEnv(t)()
oldDisabledRepoUnits := unit_model.DisabledRepoUnits
// disable repo project unit
unit_model.DisabledRepoUnits = []unit_model.Type{unit_model.TypeProjects}
defer func() {
unit_model.DisabledRepoUnits = oldDisabledRepoUnits
}()
// repo project, 404
req := NewRequest(t, "GET", "/user2/repo1/projects")