修复套餐快照集成测试与自动购包幂等
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
package task
|
||||
|
||||
// testIDMask 用于将纳秒时间戳截断为合法的 uint 主键范围,仅限测试用。
|
||||
const testIDMask = testIDMask
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
@@ -17,6 +14,9 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// testIDMask 用于将纳秒时间戳截断为合法的 uint 主键范围,仅限测试用。
|
||||
const testIDMask = 0x7fffffff
|
||||
|
||||
// TestAutoPurchasePersistsTermsSnapshotsAndRealnameDecision 验证自动购包复用快照并遵守实名起算规则。
|
||||
func TestAutoPurchasePersistsTermsSnapshotsAndRealnameDecision(t *testing.T) {
|
||||
testCases := []struct {
|
||||
@@ -192,4 +192,3 @@ func newAutoPurchaseOrder(cardID uint, sellerShopID *uint) *model.Order {
|
||||
orderID := uint(time.Now().UnixNano() & testIDMask)
|
||||
return &model.Order{Model: gorm.Model{ID: orderID}, OrderNo: "UR55-AUTO-" + strconv.FormatUint(uint64(orderID), 10), OrderType: model.OrderTypeSingleCard, IotCardID: &cardID, SellerShopID: sellerShopID, TotalAmount: 100, Generation: 1}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user