'Test that course deletion doesn\'t remove course enrollments or user\'s roles'

def test_course_enrollments_and_roles_on_delete(self):

    test_course_data = self.assert_created_course(number_suffix=uuid4().hex)
    course_id = _get_course_id(self.store, test_course_data)
    self.assertTrue(CourseEnrollment.is_enrolled(self.user, course_id))
    self.assertTrue(self.user.roles.filter(name='Student', course_id=course_id))
    delete_course(course_id, self.user.id)
    self.assertTrue(CourseEnrollment.is_enrolled(self.user, course_id))
    self.assertTrue(self.user.roles.filter(name='Student', course_id=course_id))
