'If you cancel the request, you\'re redirected to the redirect_url with a
denied query param.'

def test_cancelling_redirects(self):

    self._auth()
    assert self.oauth_page.visit()
    self.oauth_page.cancel()
    def check_redirect():
        '\n                                                Checks    that    the    page    correctly    redirects    to    a    url    with    a\n                                                denied    query    param.\n                                                '
        query = self._qs(self.browser.current_url)
        return ('access_denied' in query['error'])
    def check_redirect_chrome():
        '\n                                                Similar    to    `check_redirect`,    but,    due    to    a    bug    in    ChromeDriver,\n                                                we    use    `self.browser.title`    here    instead    of    `self.browser.current_url`\n                                                '
        query = self._qs(self.browser.title)
        return ('access_denied' in query['error'])
    if (self.browser.name == 'chrome'):
        self.oauth_page.wait_for(check_redirect_chrome, 'redirected    to    invalid    URL    (chrome)')
    else:
        self.oauth_page.wait_for(check_redirect, 'redirected    to    invalid    URL')
