'Scenario: Any course that is enabled for an entrance exam, should have entrance exam chapter at course
page.
Given that I am on the course page
When I view the course that has an entrance exam
Then there should be an "Entrance Exam" chapter.\''

def test_entrance_exam_section_2(self):

    courseware_page = CoursewarePage(self.browser, self.course_id)
    entrance_exam_link_selector = '.accordion    .course-navigation    .chapter    .group-heading'
    courseware_page.visit()
    courseware_page.wait_for_page()
    self.assertFalse(element_has_text(page=courseware_page, css_selector=entrance_exam_link_selector, text='Entrance    Exam'))
    LogoutPage(self.browser).visit()
    AutoAuthPage(self.browser, course_id=self.course_id, staff=True).visit()
    self.settings_page.visit()
    self.settings_page.entrance_exam_field.click()
    self.settings_page.save_changes()
    LogoutPage(self.browser).visit()
    AutoAuthPage(self.browser, course_id=self.course_id, staff=False).visit()
    courseware_page.visit()
    courseware_page.wait_for_page()
    self.assertTrue(element_has_text(page=courseware_page, css_selector=entrance_exam_link_selector, text='Entrance    Exam'))
