mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-05 21:58:39 -04:00
testing: Add common way to POST objects
This commit is contained in:
@ -35,8 +35,8 @@ type TestData struct {
|
||||
initialized bool
|
||||
users []User
|
||||
clients []*http.Client
|
||||
accounts []handlers.Account
|
||||
securities []handlers.Security
|
||||
accounts []handlers.Account // accounts must appear after their parents in this slice
|
||||
transactions []handlers.Transaction
|
||||
prices []handlers.Price
|
||||
reports []handlers.Report
|
||||
@ -107,5 +107,46 @@ var data = []TestData{
|
||||
Email: "jsmith@example.com",
|
||||
},
|
||||
},
|
||||
securities: []handlers.Security{
|
||||
handlers.Security{
|
||||
UserId: 0,
|
||||
Name: "USD",
|
||||
Description: "US Dollar",
|
||||
Symbol: "$",
|
||||
Precision: 2,
|
||||
Type: handlers.Currency,
|
||||
AlternateId: "840",
|
||||
},
|
||||
},
|
||||
accounts: []handlers.Account{
|
||||
handlers.Account{
|
||||
UserId: 0,
|
||||
SecurityId: 0,
|
||||
ParentAccountId: -1,
|
||||
Type: handlers.Asset,
|
||||
Name: "Assets",
|
||||
},
|
||||
handlers.Account{
|
||||
UserId: 0,
|
||||
SecurityId: 0,
|
||||
ParentAccountId: 0,
|
||||
Type: handlers.Asset,
|
||||
Name: "Credit Union Checking",
|
||||
},
|
||||
handlers.Account{
|
||||
UserId: 0,
|
||||
SecurityId: 0,
|
||||
ParentAccountId: -1,
|
||||
Type: handlers.Expense,
|
||||
Name: "Expenses",
|
||||
},
|
||||
handlers.Account{
|
||||
UserId: 0,
|
||||
SecurityId: 0,
|
||||
ParentAccountId: 2,
|
||||
Type: handlers.Expense,
|
||||
Name: "Groceries",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user