summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Huot <jonathan.huot@thomsonreuters.com>2018-08-15 00:15:40 +0200
committerJonathan Huot <jonathan.huot@thomsonreuters.com>2018-08-15 00:15:40 +0200
commit058746b3d9bed4aafbd55a7f26491b5761c35fa8 (patch)
tree8e67ada1ef7af81ff9475be8463abc3e441b373e
parent3faf434e8d670bf2763bbdc5135cbd7e747194f8 (diff)
downloadoauthlib-058746b3d9bed4aafbd55a7f26491b5761c35fa8.tar.gz
Add test when no redirecturi & no default
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_error_responses.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/oauth2/rfc6749/endpoints/test_error_responses.py b/tests/oauth2/rfc6749/endpoints/test_error_responses.py
index 677b895..00f7ba6 100644
--- a/tests/oauth2/rfc6749/endpoints/test_error_responses.py
+++ b/tests/oauth2/rfc6749/endpoints/test_error_responses.py
@@ -245,6 +245,15 @@ class ErrorResponseTest(TestCase):
body='grant_type=authorization_code&code=foo')
self.assertEqual('invalid_request', json.loads(body)['error'])
+ def test_access_denied_no_default_redirecturi(self):
+ self.validator.authenticate_client.side_effect = self.set_client
+ self.validator.get_default_redirect_uri.return_value = None
+ token_uri = 'https://i.b/token'
+ # Authorization code grant
+ _, body, _ = self.web.create_token_response(token_uri,
+ body='grant_type=authorization_code&code=foo')
+ self.assertEqual('invalid_request', json.loads(body)['error'])
+
def test_unsupported_response_type(self):
self.validator.get_default_redirect_uri.return_value = 'https://i.b/cb'