#NEWLINE# def test_create_invalid_tweet( self ) : #NEWLINE# #INDENT# self . client = APIClient ( ) #NEWLINE# self . client . login ( username = 'bob' , password = 'bob' ) #NEWLINE# url = reverse ( 'tweet-list' ) #NEWLINE# data = { #NEWLINE# #INDENT# 'text' : ( 'x' * 4 ) , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( url , data , format = 'json' ) #NEWLINE# error_msg = response . data [ 'text' ] [ 0 ] #NEWLINE# self . assertEquals ( response . status_code , 400 ) #NEWLINE# self . assertEquals ( error_msg , 'Text is too short!' )