#NEWLINE# def test_put_invalid_foreign_key( self ) : #NEWLINE# #INDENT# 'Test HTTP PUTing a resource with a field that refers to a\n        non-existent resource (i.e. violate a foreign key constraint).' #NEWLINE# response = self . app . put ( '/tracks/998' , content_type = 'application/json' , data = json . dumps ( { #NEWLINE# #INDENT# 'Name' : 'Some New Album' , #NEWLINE# 'Milliseconds' : 343719 , #NEWLINE# 'TrackId' : 998 , #NEWLINE# 'UnitPrice' : 0.99 , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# assert ( response . status_code == 422 )