diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index ee2acfe5..a81c8cdc 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -58,7 +58,7 @@ func TestRetailGetSpTagIds(t *testing.T) { if len(result) == 0 { t.Fatal("should have items") } - // t.Log(utils.Format4Output(result, false)) + t.Log(utils.Format4Output(result, false)) } func TestRetailCatSkuBatchDelete(t *testing.T) { @@ -74,3 +74,33 @@ func TestRetailDelete(t *testing.T) { t.Fatal(err) } } +func TestRetailBatchInitData(t *testing.T) { + err := api.RetailBatchInitData("2464052", []map[string]interface{}{ + map[string]interface{}{ + "app_food_code": "23841", + "box_num": 0, + "box_price": 0, + "category_name": "豆制良品🌾🌾", + "description": "", + "is_sold_out": 0, + "min_order_count": 1, + "name": "干腐竹约150g/份", + "picture": "http://image.jxc4.com/5f7fba025fc9348796039423c48ac3f5.jpg", + "price": 1000, + "skus": []map[string]interface{}{ + map[string]interface{}{ + "price": 1000, + "sku_id": "23841", + "spec": "150g", + "stock": "*", + "upc": "", + }, + }, + "tag_id": "200000380", + "unit": "份", + }, + }) + if err != nil { + t.Fatal(err) + } +}