'If the email address and username already exists
and the user is not enrolled in the course, enrolled him/her and iterate to next one.'

@patch('lms.djangoapps.instructor.views.api.log.info')
def test_csv_user_exist_and_not_enrolled(self, info_log):

    csv_content = 'nonenrolled@test.com,NotEnrolledStudent,tester1,USA'
    uploaded_file = SimpleUploadedFile('temp.csv', csv_content)
    response = self.client.post(self.url, {'students_list': uploaded_file})
    self.assertEqual(response.status_code, 200)
    info_log.assert_called_with(u'user    %s    enrolled    in    the    course    %s', u'NotEnrolledStudent', self.course.id)
    manual_enrollments = ManualEnrollmentAudit.objects.all()
    self.assertEqual(manual_enrollments.count(), 1)
    self.assertTrue(manual_enrollments[0].state_transition, UNENROLLED_TO_ENROLLED)
