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

def call_add_users_to_cohorts(self, csv_data, suffix='.csv'):

    (__, file_name) = tempfile.mkstemp(suffix=suffix, dir=self.tempdir)
    with open(file_name, 'w') as file_pointer:
        file_pointer.write(csv_data.encode('utf-8'))
    with open(file_name, 'r') as file_pointer:
        url = reverse('add_users_to_cohorts', kwargs={'course_id': unicode(self.course.id)})
        return self.client.post(url, {'uploaded-file': file_pointer})
