Skip to content

Commit

Permalink
test: redirect URI should be the last parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Feb 6, 2024
1 parent 68fddcc commit f495e5c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/oauth2/rfc6749/test_parameters.py
Expand Up @@ -37,13 +37,12 @@ def setUp(self):
self.auth_implicit_list_scope['scope'] = self.list_scope

auth_base_uri = ('https://server.example.com/authorize?response_type={0}'
'&client_id=s6BhdRkqt3&redirect_uri=https%3A%2F%2F'
'client.example.com%2Fcb&scope={1}&state={2}{3}')
'&client_id=s6BhdRkqt3&scope={1}&state={2}{3}'
'&redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb')

auth_base_uri_pkce = ('https://server.example.com/authorize?response_type={0}'
'&client_id=s6BhdRkqt3&redirect_uri=https%3A%2F%2F'
'client.example.com%2Fcb&scope={1}&state={2}{3}&code_challenge={4}'
'&code_challenge_method={5}')
'&client_id=s6BhdRkqt3&scope={1}&state={2}{3}&code_challenge={4}'
'&code_challenge_method={5}&redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb')

auth_grant_uri = auth_base_uri.format('code', 'photos', state, '')
auth_grant_uri_pkce = auth_base_uri_pkce.format('code', 'photos', state, '', 'code_challenge',
Expand Down Expand Up @@ -192,7 +191,6 @@ def setUp(self):
'&refresh_token=tGzv3JOkF0XG5Qx2TlKWIA'
'&example_parameter=example_value')


def test_prepare_grant_uri(self):
"""Verify correct authorization URI construction."""
self.assertURLEqual(prepare_grant_uri(**self.auth_grant), self.auth_grant_uri)
Expand Down Expand Up @@ -269,7 +267,6 @@ def record_scope_change(sender, message, old, new):
signals.scope_changed.disconnect(record_scope_change)
del os.environ['OAUTHLIB_RELAX_TOKEN_SCOPE']


def test_json_token_notype(self):
"""Verify strict token type parsing only when configured. """
self.assertEqual(parse_token_response(self.json_notype), self.json_notype_dict)
Expand Down

0 comments on commit f495e5c

Please sign in to comment.