mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-12 00:08:37 +00:00
refactor: form binding validation (#38832)
Make "form-fetch-action" highlight the invalid field as "error"
This commit is contained in:
@@ -104,6 +104,12 @@ func MockPrivateContext(t *testing.T, reqPath string) (*context.PrivateContext,
|
||||
return ctx, resp
|
||||
}
|
||||
|
||||
func MockRequestPostForm(req *http.Request, formData url.Values) {
|
||||
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
req.PostForm = formData
|
||||
maps.Copy(req.Form, formData)
|
||||
}
|
||||
|
||||
// LoadRepo load a repo into a test context.
|
||||
func LoadRepo(t *testing.T, ctx gocontext.Context, repoID int64) {
|
||||
var doer *user_model.User
|
||||
|
||||
Reference in New Issue
Block a user