Commits

ivirabyan  committed 1854758

Test for week interval bug

  • Participants
  • Parent commits fd2dc90

Comments (0)

Files changed (1)

File qsstats/tests.py

     def test_time_series_naive(self):
         self.assertTimeSeriesWorks(datetime.date.today())
 
+    def test_time_series_weeks(self):
+        today = datetime.date.today()
+
+        u = User.objects.create_user('user', 'user@example.com')
+        u.date_joined = today
+        u.save()
+
+        qs = User.objects.all()
+        qss = QuerySetStats(qs, 'date_joined')
+        qss.time_series(today - datetime.timedelta(days=30), today, interval='weeks')
+
     def test_until(self):
         now = compat.now()
         today = _remove_time(now)