'Verifies that all sections are collapsed if collapsed is True, otherwise all expanded.'

def verify_all_sections(self, collapsed):

    for section in self.course_outline_page.sections():
        self.assertEqual(collapsed, section.is_collapsed)
