'Verify that certificates are regenerated for all students passed in task_input.'

def test_certificate_regeneration_for_students(self):

    students = self._create_students(10)
    for student in students[:2]:
        GeneratedCertificateFactory.create(user=student, course_id=self.course.id, status=CertificateStatuses.downloadable, mode='honor')
    for student in students[2:5]:
        GeneratedCertificateFactory.create(user=student, course_id=self.course.id, status=CertificateStatuses.error, mode='honor')
    for student in students[5:6]:
        GeneratedCertificateFactory.create(user=student, course_id=self.course.id, status=CertificateStatuses.deleted, mode='honor')
    for student in students[6:7]:
        GeneratedCertificateFactory.create(user=student, course_id=self.course.id, status=CertificateStatuses.notpassing, mode='honor')
    for student in students[:7]:
        CertificateWhitelistFactory.create(user=student, course_id=self.course.id, whitelist=True)
    task_input = {'student_set': 'all_whitelisted'}
    expected_results = {'action_name': 'certificates    generated', 'total': 7, 'attempted': 7, 'succeeded': 7, 'failed': 0, 'skipped': 0}
    self.assertCertificatesGenerated(task_input, expected_results)
