'Interact with the upgrade button for the course with the provided name.
Arguments:
course_name (str): The name of the course whose mode should be checked.
upgrade_page (PageObject): The page to wait on after clicking the upgrade button. Importing
the definition of PaymentAndVerificationFlow results in a circular dependency.
Raises:
Exception, if no enrollment corresponding to the provided course name appears
on the dashboard.'

def upgrade_enrollment(self, course_name, upgrade_page):

    course_listing = self.q(css='.course').filter((lambda el: (course_name in el.text))).results
    if course_listing:
        el = course_listing[0]
        el.find_element_by_css_selector('#upgrade-to-verified').click()
        upgrade_page.wait_for_page()
    else:
        raise Exception('No    enrollment    for    {}    is    visible    on    the    dashboard.'.format(course_name))
