'Removes staff lock from a course outline item and checks whether or not a warning appears.'

def _remove_staff_lock_and_verify_warning(self, outline_item, expect_warning):

    modal = outline_item.edit()
    modal.is_explicitly_locked = False
    if expect_warning:
        self.assertTrue(modal.shows_staff_lock_warning())
    else:
        self.assertFalse(modal.shows_staff_lock_warning())
    modal.save()
