示例#1
0
    def test_index_latest(self):
        latest = date.today() - timedelta(days=5)
        UpdateCount.index({"date": latest})
        self.refresh("update_counts")

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

        start = latest.strftime('%Y-%m-%d')
        finish = datetime.date.today().strftime('%Y-%m-%d')
        with mock.patch('stats.cron.call_command') as call:
            cron.index_latest_stats()
            call.assert_called_with('index_stats', addons=None,
                                    date='%s:%s' % (start, finish))
示例#3
0
    def test_index_latest(self):
        latest = datetime.date.today() - datetime.timedelta(days=5)
        UpdateCount.index({'date': latest})
        self.refresh('update_counts')

        start = latest.strftime('%Y-%m-%d')
        finish = datetime.date.today().strftime('%Y-%m-%d')
        with mock.patch('stats.cron.call_command') as call:
            cron.index_latest_stats()
            call.assert_called_with('index_stats', addons=None,
                                    date='%s:%s' % (start, finish))