'Tests that when you delete a course with \'keep_instructors\',
it does not remove any permissions of users/groups from the course'

def test_delete_course_with_keep_instructors(self):

    test_course_data = self.assert_created_course(number_suffix=uuid4().hex)
    course_id = _get_course_id(self.store, test_course_data)
    instructor_role = CourseInstructorRole(course_id)
    instructor_role.add_users(self.user)
    self.assertTrue(instructor_role.has_user(self.user))
    delete_course(course_id, self.user.id, keep_instructors=True)
    self.user = User.objects.get_by_natural_key(self.user.natural_key()[0])
    self.assertTrue(instructor_role.has_user(self.user))
