33 lines
570 B
Go
33 lines
570 B
Go
package storage
|
|
|
|
import (
|
|
"testing"
|
|
|
|
v2 "gitea.timerzz.com/kedaya_haitao/common/structs/v2"
|
|
)
|
|
|
|
var providerArticle = v2.ProviderArticle{
|
|
ArticleID: 1,
|
|
Brand: v2.Brand_Coach,
|
|
Cost: v2.ProviderPrice{
|
|
CalMark: "111",
|
|
FinalPrice: 1,
|
|
OriginalPrice: 0,
|
|
ProviderArticleID: 0,
|
|
},
|
|
HistoryPrice: []v2.ProviderPrice{
|
|
{
|
|
CalMark: "222",
|
|
},
|
|
},
|
|
}
|
|
|
|
func TestProviderArticleApi_Upsert(t *testing.T) {
|
|
db, err := GetDevDB()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
storage := NewStorage(db)
|
|
storage.ProviderArticle().Upsert(providerArticle)
|
|
}
|