'Test that students with unicode characters in their usernames
are handled.'

@ddt.data([u'student', u'student\xec'])
def test_unicode_usernames(self, students):

    for (i, student) in enumerate(students):
        self.create_student(username=student, email='student{0}@example.com'.format(i))
    self.current_task = Mock()
    self.current_task.update_state = Mock()
    task_input = {'features': ['id', 'username', 'name', 'email', 'language', 'location', 'year_of_birth', 'gender', 'level_of_education', 'mailing_address', 'goals']}
    with patch('lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task') as mock_current_task:
        mock_current_task.return_value = self.current_task
        result = upload_students_csv(None, None, self.course.id, task_input, 'calculated')
    num_students = len(students)
    self.assertDictContainsSubset({'attempted': num_students, 'succeeded': num_students, 'failed': 0}, result)
