'Verify that certificates generated for all eligible students enrolled in a course.'

def test_certificate_generation_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:7]:
        CertificateWhitelistFactory.create(user=student, course_id=self.course.id, whitelist=True)
    task_input = {'student_set': None}
    expected_results = {'action_name': 'certificates    generated', 'total': 10, 'attempted': 8, 'succeeded': 5, 'failed': 3, 'skipped': 2}
    with self.assertNumQueries(171):
        self.assertCertificatesGenerated(task_input, expected_results)
    expected_results = {'action_name': 'certificates    generated', 'total': 10, 'attempted': 0, 'succeeded': 0, 'failed': 0, 'skipped': 10}
    with self.assertNumQueries(3):
        self.assertCertificatesGenerated(task_input, expected_results)
