-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cb712c
commit 7556bb2
Showing
8 changed files
with
1,140 additions
and
958 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -790,3 +790,116 @@ func TestSix910Mysql_ProductSubSearch(t *testing.T) { | |
|
||
dbi.Close() | ||
} | ||
|
||
func TestSix910Mysql_GetProductManufacturerListByProductSearch(t *testing.T) { | ||
var mydb mdb.MyDB | ||
mydb.Host = "localhost:3306" | ||
mydb.User = "admin" | ||
mydb.Password = "admin" | ||
mydb.Database = "six910" | ||
var dbi db.Database = &mydb | ||
|
||
var sdb Six910Mysql | ||
var l lg.Logger | ||
l.LogLevel = lg.AllLevel | ||
sdb.Log = &l | ||
sdb.DB = dbi | ||
dbi.Connect() | ||
|
||
si := sdb.GetNew() | ||
|
||
var str sdbi.Store | ||
str.City = "test vill" | ||
str.Company = "test com" | ||
str.Currency = "USD" | ||
str.Email = "[email protected]" | ||
str.FirstName = "Tester" | ||
str.LastName = "Bill" | ||
str.LocalDomain = "localhost72:8080" | ||
str.Logo = "some logo" | ||
str.OauthClientID = 10 | ||
str.OauthSecret = "this is secret" | ||
str.RemoteDomain = "www.someCart72.com" | ||
str.State = "GA" | ||
str.StoreName = "testers6 fantastic store" | ||
str.StoreSlogan = "we test for less" | ||
str.Zip = "30036" | ||
str.Enabled = false | ||
suc, sid := si.AddStore(&str) | ||
if !suc || sid == 0 { | ||
t.Fail() | ||
} | ||
|
||
var dis sdbi.Distributor | ||
dis.Company = "abc supply" | ||
dis.ContactName = "Ricky Bobby" | ||
dis.Phone = "123-456-7891" | ||
dis.StoreID = sid | ||
|
||
dsuc, did := si.AddDistributor(&dis) | ||
if !dsuc || did == 0 { | ||
t.Fail() | ||
} | ||
|
||
var prod sdbi.Product | ||
prod.Color = "red" | ||
prod.Cost = 100.51 | ||
prod.Currency = "USD" | ||
prod.Depth = 5.4 | ||
prod.Desc = "some long desc about product" | ||
prod.DistributorID = did | ||
prod.Dropship = false | ||
prod.FreeShipping = true | ||
prod.Gtin = "44555ggggg" | ||
prod.Height = 22.3 | ||
prod.Image1 = "image1" | ||
prod.Image2 = "image2" | ||
prod.Image3 = "image3" | ||
prod.Image4 = "image4" | ||
prod.Manufacturer = "some mfg" | ||
prod.Map = 150.99 | ||
prod.Msrp = 185.99 | ||
prod.MultiBox = false | ||
prod.Name = "some top product that sale well" | ||
//prod.ParentProductID | ||
prod.Price = 170.99 | ||
prod.Promoted = true | ||
prod.SalePrice = 160.99 | ||
prod.Searchable = true | ||
prod.ShipSeparately = false | ||
prod.ShippingMarkup = 3.40 | ||
prod.ShortDesc = "top product short desc" | ||
prod.Size = "XL" | ||
prod.Sku = "123456789" | ||
prod.SpecialProcessing = true | ||
prod.SpecialProcessingType = "CODE 4" | ||
prod.Stock = 55 | ||
prod.StockAlert = 10 | ||
prod.StoreID = sid | ||
prod.Thumbnail = "someimage" | ||
prod.Visible = true | ||
prod.Weight = 15.4 | ||
prod.Width = 22.4 | ||
|
||
dbi.Close() | ||
psuc, pid := si.AddProduct(&prod) | ||
if !psuc || pid == 0 { | ||
t.Fail() | ||
} | ||
|
||
dbi.Close() | ||
mlst := si.GetProductManufacturerListByProductSearch("top product", sid) | ||
fmt.Println("mlst: ", mlst) | ||
if len(*mlst) != 1 { | ||
t.Fail() | ||
} | ||
|
||
dssuc := si.DeleteStore(sid) | ||
fmt.Println("delete store in customer suc: ", dssuc) | ||
if !dssuc { | ||
t.Fail() | ||
} | ||
|
||
dbi.Close() | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters