#NEWLINE# def test_invalid_data( self ) : #NEWLINE# #INDENT# data = json . dumps ( { #NEWLINE# #INDENT# 'title' : '' , #NEWLINE# 'slug' : '' , #NEWLINE# 'content' : 'This is the content' , #NEWLINE# 'annotated' : { #NEWLINE# #INDENT# 'annotations' : None , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# resp = self . client . put ( '/api/v1/notes/1/' , data = data , content_type = 'application/json' ) #NEWLINE# self . assertEqual ( self . status_code , 400 ) #NEWLINE# self . assertEqual ( json . loads ( resp . content . decode ( 'utf-8' ) ) , { #NEWLINE# #INDENT# 'notes' : { #NEWLINE# #INDENT# 'slug' : [ 'This field is required.' ] , #NEWLINE# 'title' : [ 'This field is required.' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# 'annotated' : { #NEWLINE# #INDENT# 'annotations' : [ 'This field is required.' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } )