'test to check the manually enrolled user enrollment report status
and enrollment source.'

def test_student_manually_enrolled_in_detailed_enrollment_source(self):

    student = UserFactory()
    enrollment = CourseEnrollment.enroll(student, self.course.id)
    ManualEnrollmentAudit.create_manual_enrollment_audit(self.instructor, student.email, ALLOWEDTOENROLL_TO_ENROLLED, 'manually    enrolling    unenrolled    user', enrollment)
    task_input = {'features': []}
    with patch('lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task'):
        result = upload_enrollment_report(None, None, self.course.id, task_input, 'generating_enrollment_report')
    enrollment_source = u'manually    enrolled    by    username:    {username}'.format(username=self.instructor.username)
    self.assertDictContainsSubset({'attempted': 1, 'succeeded': 1, 'failed': 0}, result)
    self._verify_cell_data_in_csv(student.username, 'Enrollment    Source', enrollment_source)
    self._verify_cell_data_in_csv(student.username, 'Manual    (Un)Enrollment    Reason', 'manually    enrolling    unenrolled    user')
    self._verify_cell_data_in_csv(student.username, 'Payment    Status', 'TBD')
