def test_index_latest(self): self.create_switch("local-statistics-processing") latest = datetime.date.today() - datetime.timedelta(days=5) UpdateCount.index({"date": latest}) self.refresh("stats") start = latest.strftime("%Y-%m-%d") finish = datetime.date.today().strftime("%Y-%m-%d") with mock.patch("olympia.stats.cron.call_command") as call: cron.index_latest_stats() call.assert_called_with("index_stats", addons=None, date="%s:%s" % (start, finish))
def test_index_latest(self): self.create_switch('local-statistics-processing') latest = datetime.date.today() - datetime.timedelta(days=5) UpdateCount.index({'date': latest}) self.refresh('stats') start = latest.strftime('%Y-%m-%d') finish = datetime.date.today().strftime('%Y-%m-%d') with mock.patch('olympia.stats.cron.call_command') as call: cron.index_latest_stats() call.assert_called_with('index_stats', addons=None, date='%s:%s' % (start, finish))