第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Golang 收到 httptest 失敗的錯誤消息

Golang 收到 httptest 失敗的錯誤消息

Go
BIG陽 2021-07-16 17:02:53
當您返回 500 服務器錯誤時,如何使用 httptest 獲取錯誤消息?手動測試時注冊頁面有效,所以這似乎是一些管道問題,但我找不到消息是什么。func TestSignUp(t *testing.T) {    var (        password = "password"    )    newUser := entities.User{}    newUser.Email = "j@doe.co.za"       newUser.SetPassword(password, bcrypt.MinCost)    v := url.Values{}    v.Add("email_address", newUser.Email)    v.Add("password", password)         res := httptest.NewRecorder()    req := &http.Request{        Method: "POST",        URL:    &url.URL{Path: "/signup"},        Form:   v,    }    m := Martini()    m.ServeHTTP(res, req)    assert.Equal(t, 200, res.Code) <<<< res.Code = 500, but where is the error message?}
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 248 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號