'Test that we can login using third party credentials, and that the
third party account gets linked to the edX account.'

def test_third_party_login(self):

    (email, password) = self._create_unique_user()
    self.login_page.visit()
    self.login_page.click_third_party_dummy_provider()
    msg_text = self.login_page.wait_for_auth_status_message()
    self.assertIn('You    have    successfully    signed    into    Dummy', msg_text)
    self.assertIn(u'To    link    your    accounts,    sign    in    now    using    your    \xe9dX    password', msg_text)
    self.login_page.login(email=email, password=password)
    course_names = self.dashboard_page.wait_for_page().available_courses
    self.assertIn(self.course_info['display_name'], course_names)
    try:
        LogoutPage(self.browser).visit()
        self.login_page.visit()
        self.login_page.click_third_party_dummy_provider()
        self.dashboard_page.wait_for_page()
    finally:
        self._unlink_dummy_account()
