Beispiel #1
0
    def test_call_volume_for_day(self):
        overview = CallVolumeOverview(
            q("time_received__gte=2015-01-01&time_received__lte=2015-01-01"))
        assert overview.bounds == {"min_time": dtparse("2015-01-01T09:00"),
                                   "max_time": dtparse('2015-01-01T12:30')}

        assert_list_equiv(overview.volume_by_date(),
                          [{"date": dtparse("2015-01-01T09:00"), "volume": 1},
                           {"date": dtparse("2015-01-01T12:00"), "volume": 1}])
Beispiel #2
0
 def test_call_volume_for_month(self):
     overview = CallVolumeOverview(
         q("time_received__gte=2015-01-01&time_received__lte=2015-02-02"))
     results = overview.volume_by_date()
     assert overview.bounds == {"min_time": dtparse("2015-01-01T09:00"),
                                "max_time": dtparse('2015-02-01T09:00')}
     assert_list_equiv(results,
                       [{"date": dtparse("2015-01-01T00:00"), "volume": 2},
                        {"date": dtparse("2015-01-08T00:00"), "volume": 1},
                        {"date": dtparse("2015-02-01T00:00"), "volume": 1}])