mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 13:04:08 +02:00
Move web/api context related testing function into a separate package (#26859)
Just like `models/unittest`, the testing helper functions should be in a separate package: `contexttest` And complete the TODO: > // TODO: move this function to other packages, because it depends on "models" package
This commit is contained in:
1 parent
fcb4941d47
commit
e8aae43f56
21 files changed
+244
-244
No files matched your search
@@ -7,7 +7,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
"code.gitea.io/gitea/modules/test"
|
||||
"code.gitea.io/gitea/modules/contexttest"
|
||||
"code.gitea.io/gitea/routers/web/org"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -15,8 +15,8 @@ import (
|
||||
|
||||
func TestCheckProjectBoardChangePermissions(t *testing.T) {
|
||||
unittest.PrepareTestEnv(t)
|
||||
ctx, _ := test.MockContext(t, "user2/-/projects/4/4")
|
||||
test.LoadUser(t, ctx, 2)
|
||||
ctx, _ := contexttest.MockContext(t, "user2/-/projects/4/4")
|
||||
contexttest.LoadUser(t, ctx, 2)
|
||||
ctx.ContextUser = ctx.Doer // user2
|
||||
ctx.SetParams(":id", "4")
|
||||
ctx.SetParams(":boardID", "4")
|
||||
|
||||
Reference in new issue
Block a user