#NEWLINE# @ attr ( 'comments' ) #NEWLINE# def test_post_comments( self ) : #NEWLINE# #INDENT# comment_list = [ ] #NEWLINE# counter = 0 #NEWLINE# for i in range ( 1 , random . randint ( 6 , 15 ) ) : #NEWLINE# #INDENT# comment = WordPressComment ( ) #NEWLINE# comment . content = ( 'Comment #%s' % counter ) #NEWLINE# comment . user = self . userid #NEWLINE# comment_id = self . client . call ( comments . NewComment ( self . post_id , comment ) ) #NEWLINE# comment_list . append ( comment_id ) #NEWLINE# counter += 1 #NEWLINE# #UNINDENT# comment_counts = self . client . call ( comments . GetCommentCount ( self . post_id ) ) #NEWLINE# self . assertEqual ( comment_counts [ 'total_comments' ] , counter ) #NEWLINE# num_comments = 5 #NEWLINE# post_comments = self . client . call ( comments . GetComments ( { #NEWLINE# #INDENT# 'post_id' : self . post_id , #NEWLINE# 'number' : num_comments , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assert_list_of_classes ( post_comments , WordPressComment ) #NEWLINE# self . assertEqual ( num_comments , len ( post_comments ) ) #NEWLINE# for comment in comment_list : #NEWLINE# #INDENT# self . client . call ( comments . DeleteComment ( comment ) )