#NEWLINE# def _postNewDiffComment( self , review_request , review_id , comment_text , filediff_id = None , interfilediff_id = None , first_line = 10 , num_lines = 5 , issue_opened = None , issue_status = None ) : #NEWLINE# #INDENT# 'Creates a diff comment and returns the payload response.' #NEWLINE# if ( filediff_id is None ) : #NEWLINE# #INDENT# diffset = review_request . diffset_history . diffsets . latest ( ) #NEWLINE# filediff = diffset . files . all ( ) [ 0 ] #NEWLINE# filediff_id = filediff . id #NEWLINE# #UNINDENT# data = { #NEWLINE# #INDENT# 'filediff_id' : filediff_id , #NEWLINE# 'text' : comment_text , #NEWLINE# 'first_line' : first_line , #NEWLINE# 'num_lines' : num_lines , #NEWLINE# #UNINDENT# } #NEWLINE# if ( issue_status is not None ) : #NEWLINE# #INDENT# data [ 'interfilediff_id' ] = interfilediff_id #NEWLINE# #UNINDENT# if ( issue_opened is not None ) : #NEWLINE# #INDENT# data [ 'issue_opened' ] = issue_opened #NEWLINE# #UNINDENT# if ( issue_status is not None ) : #NEWLINE# #INDENT# data [ 'issue_status' ] = issue_status #NEWLINE# #UNINDENT# if review_request . local_site : #NEWLINE# #INDENT# local_site_name = review_request . local_site . name #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# local_site_name = None #NEWLINE# #UNINDENT# review = Review . objects . get ( pk = review_id ) #NEWLINE# rsp = self . api_post ( get_review_diff_comment_list_url ( review , local_site_name ) , data , expected_mimetype = review_diff_comment_item_mimetype ) #NEWLINE# self . assertEqual ( rsp [ 'stat' ] , 'ok' ) #NEWLINE# return rsp