'Call `cohort_students_and_upload` with a file generated from `csv_data`.'

def _cohort_students_and_upload(self, csv_data):

    with tempfile.NamedTemporaryFile() as temp_file:
        temp_file.write(csv_data.encode('utf-8'))
        temp_file.flush()
        with patch('lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task'):
            return cohort_students_and_upload(None, None, self.course.id, {'file_name': temp_file.name}, 'cohorted')
