#NEWLINE# def test_server_error( self ) : #NEWLINE# #INDENT# def raise_error( * args , **kwargs ) : #NEWLINE# #INDENT# raise ValueError ( ) #NEWLINE# #UNINDENT# self . validator . validate_client_id . side_effect = raise_error #NEWLINE# self . validator . authenticate_client . side_effect = raise_error #NEWLINE# self . validator . get_default_redirect_uri . return_value = 'https://i.b/cb' #NEWLINE# self . web . catch_errors = True #NEWLINE# ( _ , _ , s ) = self . web . create_authorization_response ( 'https://i.b/auth?client_id=foo&response_type=code' , scopes = [ 'foo' ] ) #NEWLINE# self . assertEqual ( s , 500 ) #NEWLINE# ( _ , _ , s ) = self . web . create_token_response ( 'https://i.b/token' , body = 'grant_type=authorization_code&code=foo' , scopes = [ 'foo' ] ) #NEWLINE# self . assertEqual ( s , 500 ) #NEWLINE# self . mobile . catch_errors = True #NEWLINE# ( _ , _ , s ) = self . mobile . create_authorization_response ( 'https://i.b/auth?client_id=foo&response_type=token' , scopes = [ 'foo' ] ) #NEWLINE# self . assertEqual ( s , 500 ) #NEWLINE# self . legacy . catch_errors = True #NEWLINE# ( _ , _ , s ) = self . legacy . create_token_response ( 'https://i.b/token' , body = 'grant_type=password&username=foo&password=foo' ) #NEWLINE# self . assertEqual ( s , 500 ) #NEWLINE# self . backend . catch_errors = True #NEWLINE# ( _ , _ , s ) = self . backend . create_token_response ( 'https://i.b/token' , body = 'grant_type=client_credentials' ) #NEWLINE# self . assertEqual ( s , 500 )