'Tests that a new record is added whenever certificate generation/regeneration task is submitted.'

def test_certificate_generation_history(self):

    instructor_task = generate_certificates_for_students(self.create_task_request(self.instructor), self.course.id)
    certificate_generation_history = CertificateGenerationHistory.objects.filter(course_id=self.course.id, generated_by=self.instructor, instructor_task=instructor_task, is_regeneration=False)
    self.assertTrue(certificate_generation_history.exists())
    instructor_task = regenerate_certificates(self.create_task_request(self.instructor), self.course.id, [CertificateStatuses.downloadable, CertificateStatuses.generating])
    certificate_generation_history = CertificateGenerationHistory.objects.filter(course_id=self.course.id, generated_by=self.instructor, instructor_task=instructor_task, is_regeneration=True)
    self.assertTrue(certificate_generation_history.exists())
