1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-03 12:48:38 -04:00

testing: Add initial report tabulation test

This commit is contained in:
2017-11-03 22:13:20 -04:00
parent 0863e5fa5c
commit 6fb66ac04e
3 changed files with 120 additions and 5 deletions

View File

@ -81,9 +81,14 @@ type Tabulation struct {
Series map[string]*Series
}
func (r *Tabulation) Write(w http.ResponseWriter) error {
func (t *Tabulation) Write(w http.ResponseWriter) error {
enc := json.NewEncoder(w)
return enc.Encode(r)
return enc.Encode(t)
}
func (t *Tabulation) Read(json_str string) error {
dec := json.NewDecoder(strings.NewReader(json_str))
return dec.Decode(t)
}
func GetReport(tx *Tx, reportid int64, userid int64) (*Report, error) {