#NEWLINE# def test_500_for_bad_validated_array_response( ) : #NEWLINE# #INDENT# request = EnhancedDummyRequest ( method = 'GET' , path = '/sample_array_response' ) #NEWLINE# response = Response ( body = simplejson . dumps ( [ { #NEWLINE# #INDENT# 'enum_value' : 'bad_enum_value' , #NEWLINE# #UNINDENT# } ] ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : 'application/json; charset=UTF-8' , #NEWLINE# #UNINDENT# } ) #NEWLINE# with pytest . raises ( ResponseValidationError ) as excinfo : #NEWLINE# #INDENT# _validate_against_tween ( request , response = request , path_pattern = '/sample_array_response' ) #NEWLINE# #UNINDENT# assert ( "'bad_enum_value' is not one of " in str ( excinfo . value ) )