Exemple #1
0
func postForm(t *testing.T, path string, values *url.Values, testFunc func(html string)) {
	defer testData.reset()
	ensureLogin()
	body, err := htmltest.PostForm(path, values)
	if err != nil {
		t.Error(err)
	}
	testFunc(body)
}
Exemple #2
0
func loginWithCred(username, passwd string) string {
	body, err := htmltest.PostForm("login", &url.Values{
		"uname":  {username},
		"passwd": {passwd},
	})
	if err != nil {
		println(err.Error())
		return ""
	}
	return body
}