예제 #1
0
 def test_log_clean_deletes(self):
     week_ago = (now() - timedelta(days=7)).date()
     months_ago = (now() - timedelta(days=60)).date()
     b1 = BugmailStat.objects.create(stat_type=BugmailStat.TOTAL, count=5, date=week_ago)
     BugmailStat.objects.create(stat_type=BugmailStat.TOTAL, count=5, date=months_ago)
     eq_(BugmailStat.objects.count(), 2)
     bm_tasks.clean_bugmail_log()
     eq_(BugmailStat.objects.count(), 1)
     eq_(BugmailStat.objects.all()[0], b1)
예제 #2
0
 def test_log_clean_deletes(self):
     week_ago = (now() - timedelta(days=7)).date()
     months_ago = (now() - timedelta(days=60)).date()
     b1 = BugmailStat.objects.create(stat_type=BugmailStat.TOTAL,
                                     count=5,
                                     date=week_ago)
     BugmailStat.objects.create(stat_type=BugmailStat.TOTAL,
                                count=5,
                                date=months_ago)
     eq_(BugmailStat.objects.count(), 2)
     bm_tasks.clean_bugmail_log()
     eq_(BugmailStat.objects.count(), 1)
     eq_(BugmailStat.objects.all()[0], b1)
예제 #3
0
파일: cron.py 프로젝트: protohub/scrumbugz
def clean_bugmails():
    """Cron version of the periodic celery task."""
    clean_bugmail_log()