def test_cb_story_comment_story_template(self): # check that cb_story() appends the comment-story template self.data['display_comment_default'] = True self.assert_(self.renderer.flavour['comment-story'] == 'comment-story') comments.cb_story(self.args) self.assertEquals('template starts:comment-story', self.args['template'])
def check_for_comments(expected): args_template = self.args['template'] comments.cb_story(self.args) self.assertEquals(expected, self.args['template']) comments.cb_story_end(self.args) self.assertEquals(expected, self.args['template']) self.args['template'] = args_template
def check_comment_output(self, expected, delete_datadir=True, **kwargs): """Posts a comment and checks its rendered output. Note that this deletes the datadir before it posts the comment! """ self.data['display_comment_default'] = True self.comment(**kwargs) comments.cb_story(self.args) self.args['template'] = '' comments.cb_story_end(self.args) self.assertEquals(expected, self.args['template']) if delete_datadir: self.delete_datadir()
def check_num_comments(expected): if self.entry.has_key("num_comments"): self.entry["num_comments"] = None comments.cb_story(self.args) self.assertEquals(expected, self.entry['num_comments'])