def test_clean_not_multiple(self): job = self.JobClass() job.queue = list(settings.RQ_QUEUES)[0] job.callable = 'scheduler.tests.test_job' job.interval = 121 job.interval_unit = 'seconds' with self.assertRaises(ValidationError): job.clean_interval_unit()
def test_clean_too_frequent(self): job = self.JobClass() job.queue = list(settings.RQ_QUEUES)[0] job.callable = 'scheduler.tests.test_job' job.interval = 30 job.result_ttl = -1 job.interval_unit = 'seconds' with self.assertRaises(ValidationError): job.clean_interval_unit()