def test_clean_undefined_result_ttl(self): job = self.JobClass() job.queue = list(settings.RQ_QUEUES)[0] job.callable = 'scheduler.tests.test_job' job.interval = 1 job.interval_unit = 'hours' job.clean_result_ttl()
def test_clean_short_result_ttl(self): job = self.JobClass() job.queue = list(settings.RQ_QUEUES)[0] job.callable = 'scheduler.tests.test_job' job.interval = 1 job.repeat = 1 job.result_ttl = 3599 job.interval_unit = 'hours' with self.assertRaises(ValidationError): job.clean_result_ttl()