商品已完成优化
This commit is contained in:
@@ -165,6 +165,31 @@ func TestArchiveAssetsMovesListingOffline(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCompleteAssetsMovesListingCompleted(t *testing.T) {
|
||||
now := time.Now()
|
||||
listing := model.RentalListing{
|
||||
Status: listingStatusRented,
|
||||
InTransaction: true,
|
||||
PublishedAt: &now,
|
||||
}
|
||||
account := model.GameAccount{Status: accountStatusRented}
|
||||
|
||||
completeAssets(&listing, &account)
|
||||
|
||||
if listing.Status != listingStatusCompleted {
|
||||
t.Fatalf("listing.Status = %q, want %q", listing.Status, listingStatusCompleted)
|
||||
}
|
||||
if listing.InTransaction {
|
||||
t.Fatal("listing.InTransaction = true, want false")
|
||||
}
|
||||
if listing.PublishedAt != nil {
|
||||
t.Fatal("listing.PublishedAt is not nil")
|
||||
}
|
||||
if account.Status != accountStatusOffline {
|
||||
t.Fatalf("account.Status = %q, want %q", account.Status, accountStatusOffline)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewOrderNoUsesShanghaiTimeWhenLocalIsUTC(t *testing.T) {
|
||||
oldLocal := time.Local
|
||||
time.Local = time.UTC
|
||||
|
||||
Reference in New Issue
Block a user