Commits

Mikhail Korobov committed b11c991

Consistent interval handling for all backends (this is backwards-incompatible if slow_time_series method was used)

Comments (0)

Files changed (2)

         method = getattr(self, 'for_%s' % interval[:-1])
         stat_list = []
         dt, end = _to_datetime(start), _to_datetime(end)
-        while dt < end:
+        while dt <= end:
             value = method(dt, date_field, aggregate)
             stat_list.append((dt, value,))
             dt = dt + relativedelta(**{interval : 1})
         qs = User.objects.all()
         qss = QuerySetStats(qs, 'date_joined')
         time_series = qss.time_series(seven_days_ago, today)
-        self.assertEqual([t[1] for t in time_series], [0, 1, 2, 3, 4, 5, 6])
+        self.assertEqual([t[1] for t in time_series], [0, 1, 2, 3, 4, 5, 6, 7])
 
     def test_until(self):
         today = datetime.date.today()