Example #1
0
 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'])
Example #2
0
 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
Example #3
0
 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
Example #4
0
    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()
Example #5
0
    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()
Example #6
0
 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"])
Example #7
0
 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"])
Example #8
0
 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'])