#NEWLINE# def test_404_custom_message( self ) : #NEWLINE# #INDENT# "\n        Test that if the decorated function throws a NotFound error with a\n        specified message, a JSON response of status 404 is returned with\n        'error' set to the custom message.\n        " #NEWLINE# @ nice_json #NEWLINE# def error_function( ) : #NEWLINE# #INDENT# raise NotFound ( 'Could not find the Grail!' ) #NEWLINE# #UNINDENT# response = error_function ( ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'data' : None , #NEWLINE# 'status' : 404 , #NEWLINE# 'error' : 'Could not find the Grail!' , #NEWLINE# #UNINDENT# } , self . json ) #NEWLINE# self . assertEqual ( 404 , response . status_code )