'Test that entrance exam should be created after checking the \'enable entrance exam\' checkbox.
And user has option to add units only instead of any Subsection.'

@flaky
def test_entrance_exam_has_unit_button(self):

    self.settings_detail.require_entrance_exam(required=True)
    self.settings_detail.save_changes()
    course_outline_page = CourseOutlinePage(self.browser, self.course_info['org'], self.course_info['number'], self.course_info['run'])
    course_outline_page.visit()
    course_outline_page.wait_for_ajax()
    self.assertTrue(element_has_text(page=course_outline_page, css_selector='.add-item    a.button-new', text='New    Unit'))
    self.assertFalse(element_has_text(page=course_outline_page, css_selector='.add-item    a.button-new', text='New    Subsection'))
