#NEWLINE# def test_no_null( self ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'question' : None , #NEWLINE# #UNINDENT# } #NEWLINE# body = json . dumps ( data ) #NEWLINE# ( response , content ) = self . client . put ( path = '/api/poll-no-null/1/' , body = body , headers = { #NEWLINE# #INDENT# 'Content-Type' : 'application/json' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( response . status == http . client . BAD_REQUEST ) #NEWLINE# data = json . loads ( content . decode ( 'utf8' ) ) #NEWLINE# assert ( response [ 'question' ] == [ 'Must not be null.' ] )