Пример #1
0
    def test_includes_hourly_report_with_no_orders(self):
        report = IndexView().get_hourly_report()
        self.assertEqual(len(report), 3)
        for i, j in zip(sorted(report.keys()),
                ['max_revenue', 'order_total_hourly', 'y_range']):
            self.assertEqual(i, j)

        self.assertEqual(len(report['order_total_hourly']), 12)
        self.assertEqual(len(report['y_range']), 0)
        self.assertEqual(report['max_revenue'], 0)
    def test_includes_hourly_report_with_no_orders(self):
        report = IndexView().get_hourly_report()
        self.assertEqual(len(report), 3)
        for i, j in zip(sorted(report.keys()),
                        ['max_revenue', 'order_total_hourly', 'y_range']):
            self.assertEqual(i, j)

        self.assertEqual(len(report['order_total_hourly']), 12)
        self.assertEqual(len(report['y_range']), 0)
        self.assertEqual(report['max_revenue'], 0)
Пример #3
0
 def test_dashboard_hourly_report_with_no_orders(self):
     report = IndexView().get_hourly_report()
     self.assertItemsEqual(report,
                           ['order_total_hourly', 'max_revenue', 'y_range'])
     self.assertEquals(len(report['order_total_hourly']), 24)
     self.assertEquals(len(report['y_range']), 0)
     self.assertEquals(report['max_revenue'], 0)
Пример #4
0
    def test_dashboard_hourly_report_with_orders(self):
        create_order(total_incl_tax=D('34.05'), total_excl_tax=D('34.05'))
        create_order(total_incl_tax=D('21.90'), total_excl_tax=D('21.90'))
        report = IndexView().get_hourly_report()

        self.assertEquals(len(report['order_total_hourly']), 24)
        self.assertEquals(len(report['y_range']), 11)
        self.assertEquals(report['max_revenue'], D('60'))
Пример #5
0
    def test_includes_hourly_report_with_orders(self):
        create_order(
            total=prices.Price('GBP', excl_tax=D('34.05'), tax=D('0.00')))
        create_order(
            total=prices.Price('GBP', excl_tax=D('21.90'), tax=D('0.00')))
        report = IndexView().get_hourly_report(Order.objects.all())

        self.assertEqual(len(report['order_total_hourly']), 12)
        self.assertEqual(len(report['y_range']), 11)
        self.assertEqual(report['max_revenue'], D('60'))