forked from forgejo/forgejo
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:
parent
fcb4941d47
commit
e8aae43f56
21 changed files with 244 additions and 244 deletions
|
@ -8,8 +8,8 @@ import (
|
|||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
"code.gitea.io/gitea/modules/contexttest"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/test"
|
||||
"code.gitea.io/gitea/modules/web"
|
||||
"code.gitea.io/gitea/services/forms"
|
||||
|
||||
|
@ -83,9 +83,9 @@ func TestChangePassword(t *testing.T) {
|
|||
t.Run(req.OldPassword+"__"+req.NewPassword, func(t *testing.T) {
|
||||
unittest.PrepareTestEnv(t)
|
||||
setting.PasswordComplexity = req.PasswordComplexity
|
||||
ctx, _ := test.MockContext(t, "user/settings/security")
|
||||
test.LoadUser(t, ctx, 2)
|
||||
test.LoadRepo(t, ctx, 1)
|
||||
ctx, _ := contexttest.MockContext(t, "user/settings/security")
|
||||
contexttest.LoadUser(t, ctx, 2)
|
||||
contexttest.LoadRepo(t, ctx, 1)
|
||||
|
||||
web.SetForm(ctx, &forms.ChangePasswordForm{
|
||||
OldPassword: req.OldPassword,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue