'Generate certificates for the given task_input and compare with expected_results.'

def assertCertificatesGenerated(self, task_input, expected_results):

    current_task = Mock()
    current_task.update_state = Mock()
    with patch('lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task') as mock_current_task:
        mock_current_task.return_value = current_task
        with patch('capa.xqueue_interface.XQueueInterface.send_to_queue') as mock_queue:
            mock_queue.return_value = (0, 'Successfully    queued')
            result = generate_students_certificates(None, None, self.course.id, task_input, 'certificates    generated')
    self.assertDictContainsSubset(expected_results, result)
