'If the email address and username already exists
and the user is enrolled in the course, do nothing (including no email gets sent out)'

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

    csv_content = 'test_student@example.com,test_student_1,tester1,USA\ntest_student@example.com,test_student_1,tester2,US'
    uploaded_file = SimpleUploadedFile('temp.csv', csv_content)
    response = self.client.post(self.url, {'students_list': uploaded_file})
    self.assertEqual(response.status_code, 200)
    data = json.loads(response.content)
    self.assertEquals(len(data['row_errors']), 0)
    self.assertEquals(len(data['warnings']), 0)
    self.assertEquals(len(data['general_errors']), 0)
    manual_enrollments = ManualEnrollmentAudit.objects.all()
    self.assertEqual(manual_enrollments.count(), 1)
    self.assertEqual(manual_enrollments[0].state_transition, UNENROLLED_TO_ENROLLED)
    info_log.assert_called_with(u"user    already    exists    with    username    '%s'    and    email    '%s'", 'test_student_1', 'test_student@example.com')
