'Perform the supplied action and then verify the resulting ordering.'

def do_action_and_verify(self, outline_page, action, expected_ordering):

    if (outline_page is None):
        outline_page = self.course_outline_page.visit()
    action(outline_page)
    verify_ordering(self, outline_page, expected_ordering)
    outline_page = self.course_outline_page.visit()
    outline_page.q(css='.outline-item.outline-subsection.is-collapsed    .ui-toggle-expansion').click()
    verify_ordering(self, outline_page, expected_ordering)
