访问京东API,获取结账必要信息。
This commit is contained in:
32
business/controller/elm/order_test.go
Normal file
32
business/controller/elm/order_test.go
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package elm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals/db"
|
||||||
|
"github.com/astaxie/beego"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
//E:/goprojects/src/git.rosy.net.cn/jx-callback/conf/app.conf
|
||||||
|
///Users/xujianhua/go/src/git.rosy.net.cn/jx-callback/conf/app.conf
|
||||||
|
beego.InitBeegoBeforeTest("Users/xujianhua/go/src/git.rosy.net.cn/jx-callback/conf/app.conf")
|
||||||
|
beego.BConfig.RunMode = "dev" // InitBeegoBeforeTest会将runmode设置为test
|
||||||
|
|
||||||
|
globals.Init()
|
||||||
|
db.Init()
|
||||||
|
api.Init()
|
||||||
|
}
|
||||||
|
|
||||||
|
func Test_GetOrder(t *testing.T) {
|
||||||
|
orderID := "3025427524410871880"
|
||||||
|
order, err := new(OrderController).GetOrder(orderID)
|
||||||
|
if err != nil {
|
||||||
|
panic(err.Error())
|
||||||
|
}
|
||||||
|
if order.VendorOrderID != orderID {
|
||||||
|
panic(err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user