'Verify that only course run certificates with a passing status are selected.'

def test_handle_passing_status(self, mock_task, mock_get_programs):

    data = [ProgramFactory(courses=[CourseFactory(course_runs=[CourseRunFactory(key=self.course_run_key)])])]
    mock_get_programs.return_value = data
    passing_status = CertificateStatuses.downloadable
    failing_status = CertificateStatuses.notpassing
    self.assertIn(passing_status, CertificateStatuses.PASSED_STATUSES)
    self.assertNotIn(failing_status, CertificateStatuses.PASSED_STATUSES)
    GeneratedCertificateFactory(user=self.alice, course_id=self.course_run_key, mode=MODES.verified, status=passing_status)
    GeneratedCertificateFactory(user=self.bob, course_id=self.course_run_key, mode=MODES.verified, status=failing_status)
    call_command('backpopulate_program_credentials', commit=True)
    mock_task.assert_called_once_with(self.alice.username)
