def test_get_authorize_url_does_not_show_dialog_by_default(self): auth = SpotifyImplicitGrant("CLID", "REDIR") url = auth.get_authorize_url() parsed_url = urllibparse.urlparse(url) parsed_qs = urllibparse.parse_qs(parsed_url.query) self.assertNotIn('show_dialog', parsed_qs)
def test_get_authorize_url_shows_dialog_when_requested(self): auth = SpotifyImplicitGrant("CLID", "REDIR", show_dialog=True) url = auth.get_authorize_url() parsed_url = urllibparse.urlparse(url) parsed_qs = urllibparse.parse_qs(parsed_url.query) self.assertTrue(parsed_qs['show_dialog'])
def test_get_authorize_url_passes_state_from_func_call(self): state = "STATE" auth = SpotifyImplicitGrant("CLID", "REDIR", "NOT STATE") url = auth.get_authorize_url(state=state) parsed_url = urllibparse.urlparse(url) parsed_qs = urllibparse.parse_qs(parsed_url.query) self.assertEqual(parsed_qs['state'][0], state)