summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Gregson <mark.gregson@anu.edu.au>2019-06-06 14:08:18 +1000
committerMark Gregson <mark.gregson@anu.edu.au>2019-06-06 14:08:18 +1000
commit09bcb01032a21a4bfa0c478ea8ae66ec8ace957a (patch)
treed97093236062ecf236ff9d05df6faef2729c0e58 /tests
parentf559d8b5b55281b19e1911c320fcd11676e199ab (diff)
downloadoauthlib-09bcb01032a21a4bfa0c478ea8ae66ec8ace957a.tar.gz
Check for authorization response errors
Diffstat (limited to 'tests')
-rw-r--r--tests/oauth2/rfc6749/test_parameters.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/oauth2/rfc6749/test_parameters.py b/tests/oauth2/rfc6749/test_parameters.py
index c42f516..0d293cc 100644
--- a/tests/oauth2/rfc6749/test_parameters.py
+++ b/tests/oauth2/rfc6749/test_parameters.py
@@ -73,7 +73,8 @@ class ParameterTests(TestCase):
error_nocode = 'https://client.example.com/cb?state=xyz'
error_nostate = 'https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA'
error_wrongstate = 'https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA&state=abc'
- error_response = 'https://client.example.com/cb?error=access_denied&state=xyz'
+ error_denied = 'https://client.example.com/cb?error=access_denied&state=xyz'
+ error_invalid = 'https://client.example.com/cb?error=invalid_request&state=xyz'
implicit_base = 'https://example.com/cb#access_token=2YotnFZFEjr1zCsicMWpAA&scope=abc&'
implicit_response = implicit_base + 'state={0}&token_type=example&expires_in=3600'.format(state)
@@ -180,8 +181,10 @@ class ParameterTests(TestCase):
self.assertRaises(MissingCodeError, parse_authorization_code_response,
self.error_nocode)
- self.assertRaises(MissingCodeError, parse_authorization_code_response,
- self.error_response)
+ self.assertRaises(AccessDeniedError, parse_authorization_code_response,
+ self.error_denied)
+ self.assertRaises(InvalidRequestFatalError, parse_authorization_code_response,
+ self.error_invalid)
self.assertRaises(MismatchingStateError, parse_authorization_code_response,
self.error_nostate, state=self.state)
self.assertRaises(MismatchingStateError, parse_authorization_code_response,