#NEWLINE# def test_not_write( self ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'id' : 123 , #NEWLINE# 'question' : 'gr9uer0gn2w' , #NEWLINE# #UNINDENT# } #NEWLINE# body = json . dumps ( data ) #NEWLINE# ( response , content ) = self . client . put ( path = '/api/poll-unwrite/1/' , body = body , headers = { #NEWLINE# #INDENT# 'Content-Type' : 'application/json' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( body . status == http . client . BAD_REQUEST ) #NEWLINE# data = json . loads ( content . decode ( 'utf8' ) ) #NEWLINE# assert ( data [ 'question' ] == [ 'Attribute is read-only.' ] )