diff options
| author | Weipin Xia <xia@weip.in> | 2015-05-07 00:54:59 +0800 |
|---|---|---|
| committer | Omer Katz <omer.drow@gmail.com> | 2015-07-19 11:46:15 +0300 |
| commit | e161d8412224b980b67c21fcc268edf675c6a7da (patch) | |
| tree | fd31d0c8834d4fb99ed8bbcc24b93db9e8e0b063 /tests | |
| parent | 8a44ea0825a723da2bd8441ba46f903945d07299 (diff) | |
| download | oauthlib-e161d8412224b980b67c21fcc268edf675c6a7da.tar.gz | |
Add code to determine if client authentication is required for OAuth2 endpoint "revocation"
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py b/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py index aa3b89c..9ddcc1e 100644 --- a/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py +++ b/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py @@ -32,6 +32,18 @@ class RevocationEndpointTest(TestCase): self.assertEqual(h, {}) self.assertEqual(b, '') self.assertEqual(s, 200) + + def test_revoke_token_without_client_authentication(self): + self.validator.client_authentication_required.return_value = False + self.validator.authenticate_client.return_value = False + for token_type in ('access_token', 'refresh_token', 'invalid'): + body = urlencode([('token', 'foo'), + ('token_type_hint', token_type)]) + h, b, s = self.endpoint.create_revocation_response(self.uri, + headers=self.headers, body=body) + self.assertEqual(h, {}) + self.assertEqual(b, None) + self.assertEqual(s, 200) def test_revoke_token_without_client_authentication(self): self.validator.client_authentication_required.return_value = False |
