mirror of
https://github.com/go-gitea/gitea.git
synced 2025-12-08 17:55:50 +01:00
Fix test
This commit is contained in:
parent
40ddacfe4f
commit
09c0c456a8
@ -98,7 +98,15 @@ func uploadArchive(t *testing.T, session *TestSession, path string, archive []by
|
|||||||
|
|
||||||
req := NewRequestWithBody(t, "POST", path, bytes.NewReader(body.Bytes()))
|
req := NewRequestWithBody(t, "POST", path, bytes.NewReader(body.Bytes()))
|
||||||
req.Header.Set("Content-Type", writer.FormDataContentType())
|
req.Header.Set("Content-Type", writer.FormDataContentType())
|
||||||
session.MakeRequest(t, req, http.StatusSeeOther)
|
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||||
|
doc := NewHTMLParser(t, resp.Body)
|
||||||
|
token := doc.GetInputValueByName("token")
|
||||||
|
require.NotEmpty(t, token, "pending upload token not found")
|
||||||
|
confirmReq := NewRequestWithValues(t, "POST", path+"/confirm", map[string]string{
|
||||||
|
"_csrf": GetUserCSRFToken(t, session),
|
||||||
|
"token": token,
|
||||||
|
})
|
||||||
|
session.MakeRequest(t, confirmReq, http.StatusSeeOther)
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildRenderPluginArchive(t *testing.T, id, name, version string) []byte {
|
func buildRenderPluginArchive(t *testing.T, id, name, version string) []byte {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user