feat: 支持顺运宝批量创建采集任务 (#153)

This commit is contained in:
chengma
2026-08-11 14:59:26 +08:00
parent 2629e41211
commit b527204204
12 changed files with 341 additions and 14 deletions
+23
View File
@@ -166,3 +166,26 @@ func TestPurchaseTaskOptionsFromForm_忽略篡改模式并固定Live(t *testing.
t.Fatalf("采购客户端读取错误: %+v", options)
}
}
func TestSybCollectPddBatch_未选择时保留列表筛选(t *testing.T) {
context, recorder := sybPostContext(t, url.Values{
"order_no": {"ORDER-1"}, "shop": {"qwg8fkb044"},
"stage": {"pdd_pending"}, "page": {"2"},
})
(&Handler{}).SybCollectPddBatch(context)
location, err := url.Parse(recorder.Header().Get("Location"))
if err != nil {
t.Fatal(err)
}
query := location.Query()
for name, want := range map[string]string{
"order_no": "ORDER-1", "shop": "qwg8fkb044", "stage": "pdd_pending", "page": "2",
} {
if got := query.Get(name); got != want {
t.Errorf("批量采集返回丢失 %s:got=%q want=%q Location=%s", name, got, want, location.String())
}
}
if !strings.Contains(query.Get("msg"), "没有选择") {
t.Fatalf("未选择应返回可读提示:%s", location.String())
}
}