- fixed a bug in defsch.init, replace LoadOrder with GetOrder.

- dynamic table name for legacy order related table.
This commit is contained in:
gazebo
2018-07-23 17:30:22 +08:00
parent 96d8e7b2fa
commit 479ce46200
18 changed files with 253 additions and 80 deletions

View File

@@ -0,0 +1,42 @@
package mtps
import (
"testing"
"git.rosy.net.cn/jx-callback/business/controller"
"git.rosy.net.cn/jx-callback/business/model"
"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() {
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 TestCreateWaybill(t *testing.T) {
orerID := "817109342000022"
order, _ := controller.OrderManager.LoadOrder(orerID, model.VendorIDJD)
// globals.SugarLogger.Debug(order)
c := new(WaybillController)
if err := c.CreateWaybill(order); err != nil {
t.Fatal(err.Error())
}
}
func TestCancelWaybill(t *testing.T) {
bill := &model.Waybill{
VendorWaybillID: "1532332342088966",
VendorWaybillID2: "55",
}
c := new(WaybillController)
if err := c.CancelWaybill(bill); err != nil {
t.Fatal(err.Error())
}
}