mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-13 17:35:18 +02:00
revert: fixture and test changes
give all existing fixture repos a group id of 0
This commit is contained in:
parent
cdf24a58a2
commit
d4f6f2b952
@ -11,14 +11,12 @@ import (
|
|||||||
|
|
||||||
auth_model "code.gitea.io/gitea/models/auth"
|
auth_model "code.gitea.io/gitea/models/auth"
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
group_model "code.gitea.io/gitea/models/group"
|
|
||||||
"code.gitea.io/gitea/models/organization"
|
"code.gitea.io/gitea/models/organization"
|
||||||
"code.gitea.io/gitea/models/perm"
|
"code.gitea.io/gitea/models/perm"
|
||||||
"code.gitea.io/gitea/models/unit"
|
"code.gitea.io/gitea/models/unit"
|
||||||
"code.gitea.io/gitea/models/unittest"
|
"code.gitea.io/gitea/models/unittest"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
api "code.gitea.io/gitea/modules/structs"
|
api "code.gitea.io/gitea/modules/structs"
|
||||||
group_service "code.gitea.io/gitea/services/group"
|
|
||||||
"code.gitea.io/gitea/tests"
|
"code.gitea.io/gitea/tests"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@ -203,12 +201,6 @@ func testOrgRestrictedUser(t *testing.T) {
|
|||||||
AddTokenAuth(token)
|
AddTokenAuth(token)
|
||||||
_ = adminSession.MakeRequest(t, req, http.StatusNoContent)
|
_ = adminSession.MakeRequest(t, req, http.StatusNoContent)
|
||||||
|
|
||||||
// we also need to give this new team access to the repo's group
|
|
||||||
g := unittest.AssertExistsAndLoadBean[*group_model.Group](t, &group_model.Group{
|
|
||||||
ID: int64(repoGroup),
|
|
||||||
})
|
|
||||||
assert.NoError(t, group_service.AddTeamToGroup(t.Context(), g, apiTeam.Name))
|
|
||||||
|
|
||||||
// Now we need to check if the restrictedUser can access the repo
|
// Now we need to check if the restrictedUser can access the repo
|
||||||
req = NewRequest(t, "GET", "/"+orgName)
|
req = NewRequest(t, "GET", "/"+orgName)
|
||||||
restrictedSession.MakeRequest(t, req, http.StatusOK)
|
restrictedSession.MakeRequest(t, req, http.StatusOK)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user