#NEWLINE# def test_valid_data( self ) : #NEWLINE# #INDENT# data = json . dumps ( { #NEWLINE# #INDENT# 'title' : 'Test Title' , #NEWLINE# 'slug' : 'test-title' , #NEWLINE# 'content' : 'This is the content' , #NEWLINE# 'user' : { #NEWLINE# #INDENT# 'pk' : 1 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'annotated' : { #NEWLINE# #INDENT# 'annotations' : 'This is an annotations' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# resp = self . client . post ( '/api/v1/notes/' , data = data , content_type = 'application/json' ) #NEWLINE# self . assertEqual ( resp . status_code , 201 ) #NEWLINE# note = json . loads ( self . client . get ( resp [ 'location' ] ) . content . decode ( 'utf-8' ) ) #NEWLINE# self . assertTrue ( note [ 'annotated' ] )