def __init__(self, store): """A dialog to print the PaymentFlowHistoryReport report. :param store: a store """ self.store = store DateRangeDialog.__init__(self, title=self.title, header_text=self.desc)
def confirm(self): DateRangeDialog.confirm(self) start = self.retval.start end = self.retval.end results = PaymentFlowDay.get_flow_history(self.store, start, end) if not results: info(_('No payment history found.')) return False print_report(PaymentFlowHistoryReport, payment_histories=results) return True
def test_confirm(self): dialog = DateRangeDialog() start = end = datetime.date(2013, 1, 1) dialog.date_filter.set_state(start=start, end=end) dialog.confirm() self.assertEqual(dialog.retval, date_range(start=start, end=end)) dialog = DateRangeDialog() start = datetime.date(2013, 1, 1) end = datetime.date(2013, 2, 1) dialog.date_filter.set_state(start=start, end=end) dialog.confirm() self.assertEqual(dialog.retval, date_range(start=start, end=end))
def test_create(self): dialog = DateRangeDialog() self.check_dialog(dialog, 'dialog-date-range')