Modify the call of JSONMarshal in the unit test
This commit is contained in:
parent
efd710a652
commit
d6f939ac09
@ -437,12 +437,12 @@ func TestBeegoHTTPRequestXMLBody(t *testing.T) {
|
|||||||
func TestBeegoHTTPRequestResponseForValue(t *testing.T) {
|
func TestBeegoHTTPRequestResponseForValue(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBeegoHTTPRequestMarshal(t *testing.T) {
|
func TestBeegoHTTPRequestJSONMarshal(t *testing.T) {
|
||||||
req := Post("http://beego.me")
|
req := Post("http://beego.me")
|
||||||
req.SetEscapeHTML(false)
|
req.SetEscapeHTML(false)
|
||||||
body := map[string]interface{} {
|
body := map[string]interface{} {
|
||||||
"escape": "left&right",
|
"escape": "left&right",
|
||||||
}
|
}
|
||||||
b, _ := req.Marshal(body)
|
b, _ := req.JSONMarshal(body)
|
||||||
assert.Equal(t,fmt.Sprintf(`{"escape":"left&right"}%s`, "\n"), string(b))
|
assert.Equal(t,fmt.Sprintf(`{"escape":"left&right"}%s`, "\n"), string(b))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user