'Verify that an error is raised when trying to add users to a cohort
which does not belong to the given course.'

def test_non_existent_cohort(self):

    users = [UserFactory(username='user{0}'.format(i)) for i in range(3)]
    usernames = [user.username for user in users]
    wrong_course_key = CourseLocator('some', 'arbitrary', 'course')
    wrong_course_cohort = CohortFactory(name='wrong_cohort', course_id=wrong_course_key, users=[])
    self.request_add_users_to_cohort(','.join(usernames), wrong_course_cohort, self.course, should_raise_404=True)
