'Passing role names via the course_access_roles query string parameter should create CourseAccessRole
objects associated with the user.'

def test_course_access_roles(self):

    expected_roles = ['finance_admin', 'sales_admin']
    course_key = CourseLocator.from_string(self.COURSE_ID_SPLIT)
    params = {'course_id': str(course_key), 'course_access_roles': ','.join(expected_roles)}
    response = self._auto_auth(params)
    user_info = json.loads(response.content)
    for role in expected_roles:
        self.assertTrue(CourseAccessRole.objects.filter(user__id=user_info['user_id'], course_id=course_key, org=course_key.org, role=role).exists())
