'Adds a user to the specified cohort.'

def add_user_to_cohort(self, course_fixture, username, cohort_id):

    url = (((LMS_BASE_URL + '/courses/') + course_fixture._course_key) + '/cohorts/{}/add'.format(cohort_id))
    data = {'users': username}
    course_fixture.headers['Content-type'] = 'application/x-www-form-urlencoded'
    response = course_fixture.session.post(url, data=data, headers=course_fixture.headers)
    self.assertTrue(response.ok, 'Failed    to    add    user    to    cohort')
