def test_invalid_scope(self): from oauth2_provider.provider import BaseProvider provider = BaseProvider() results = provider.invalid_scope() assert results['error'] == 'invalid_scope'
def test_unauthorized_client(self): from oauth2_provider.provider import BaseProvider provider = BaseProvider() results = provider.unauthorized_client() assert results['error'] == 'unauthorized_client'
def test_access_denied(self): from oauth2_provider.provider import BaseProvider provider = BaseProvider() results = provider.access_denied() assert results['error'] == 'access_denied'
def test_unsupported_response_type(self): from oauth2_provider.provider import BaseProvider provider = BaseProvider() results = provider.unsupported_response_type() assert results['error'] == 'unsupported_response_type'
def test_refresh_token(self): from oauth2_provider.provider import BaseProvider provider = BaseProvider() token = provider.generate_refresh_token() assert len(token) == provider.token_length
def test_authorization_code(self): from oauth2_provider.provider import BaseProvider provider = BaseProvider() auth_code = provider.generate_authorization_code() assert len(auth_code) == provider.token_length
def test_response_error(self): from oauth2_provider.provider import BaseProvider provider = BaseProvider() results = provider.response_error('foo') assert results == {'error': 'foo'} results = provider.response_error('bar', error_description='baz', error_uri='google.com', redirect_uri='cnn.com', state='foo' ) assert results == { 'error': 'bar' , 'error_description': 'baz' , 'error_uri': 'google.com' , 'redirect_uri': 'cnn.com' , 'state': 'foo' }