def test_defaultDate_report(self): netIncomeReport = NetIncomeReport() # datetime.date(2016, 3, 12) netIncomeReport.filterDateRange() result = netIncomeReport.result() # print(result) self.assertEquals(1900, result['income']['total']) self.assertEquals(1900, result['netIncome'])
def get(self): qParser = reqparse.RequestParser() qParser.add_argument("fromDate", type=dateInput, default=None) qParser.add_argument("toDate", type=dateInput, default=None) args = qParser.parse_args() fromDate = args.get("fromDate") toDate = args.get("toDate") netIncomeReport = NetIncomeReport() netIncomeReport.filterDateRange(fromDate, toDate) return netIncomeReport.result()
def get(self): qParser = reqparse.RequestParser() qParser.add_argument('fromDate', type=dateInput, default=None) qParser.add_argument('toDate', type=dateInput, default=None) qParser.add_argument('category_id', type=int, default=None) args = qParser.parse_args() fromDate = args.get('fromDate') toDate = args.get('toDate') category_id = args.get('category_id') netIncomeReport = NetIncomeReport() netIncomeReport.filterDateRange(fromDate, toDate) netIncomeReport.filterByCategory(category_id) return netIncomeReport.result()