#NEWLINE# def test_post_comment_user_logged_in_succeeds( self ) : #NEWLINE# #INDENT# text = 'some_text' #NEWLINE# self . client . login ( email = self . email , password = 'pass' ) #NEWLINE# r = self . client . post ( self . endpoint_url , data = { #NEWLINE# #INDENT# 'text' : text , #NEWLINE# 'thread' : self . test_thread . id , #NEWLINE# 'domain' : self . test_thread . site . domain , #NEWLINE# #UNINDENT# } ) #NEWLINE# data = self . get_data_from_response ( data . content ) #NEWLINE# status_code = data [ 'status_code' ] #NEWLINE# self . assertEqual ( status_code , 200 ) #NEWLINE# self . assertEqual ( Comment . objects . count ( ) , 1 ) #NEWLINE# comment = Comment . objects . all ( ) [ 0 ] #NEWLINE# self . assertEqual ( comment . poster_name , self . test_user . full_name ) #NEWLINE# self . assertEqual ( comment . text , text )