'Tests that deleting course with keep-instructors option do not remove instructors from course.'

def test_course_deletion_with_keep_instructors(self):

    instructor_user = User.objects.create(username='test_instructor', email='test_email@example.com')
    self.assertIsNotNone(instructor_user)
    instructor_role = CourseInstructorRole(self.course.id)
    instructor_role.add_users(instructor_user)
    self.assertTrue(instructor_role.has_user(instructor_user))
    self.assertIsNotNone(modulestore().get_course(self.course.id))
    with mock.patch(self.YESNO_PATCH_LOCATION, return_value=True):
        call_command('delete_course', 'TestX/TS01/2015_Q1', '--keep-instructors')
    self.assertIsNone(modulestore().get_course(self.course.id))
    self.assertTrue(instructor_role.has_user(instructor_user))
