def test_correct_js(self):
        """ The Javascript used is generated according to the short name
        """
        viewlet = CommentsCountViewlet(self.context, self.request, None, None)

        self.assertIn(
            'http://testblog.disqus.com/count.js', viewlet.get_counter_js())
 def test_viewlet_not_renders_for_improper_object(self):
     """ Only objects that have their comments enabled should
     show the viewlet
     """
     self.context.allow_discussion = False
     viewlet = CommentsCountViewlet(self.context, self.request, None, None)
     self.assertFalse(viewlet.is_discussion_allowed())
 def test_viewlet_not_renders_for_improper_object(self):
     """ Only objects that have their comments enabled should
     show the viewlet
     """
     self.context.allow_discussion = False
     viewlet = CommentsCountViewlet(self.context, self.request, None, None)
     self.assertFalse(viewlet.is_discussion_allowed())
    def test_viewlet_renders_for_proper_object(self):
        """ Only objects that have their comments enabled should
        show the viewlet
        """
        self.discussionTool.overrideDiscussionFor(self.portal.doc1, True)

        viewlet = CommentsCountViewlet(self.context, self.request, None, None)
        self.assertTrue(viewlet.is_discussion_allowed())
    def test_correct_js(self):
        """ The Javascript used is generated according to the short name
        """
        self.discussionTool.overrideDiscussionFor(self.portal.doc1, True)

        viewlet = CommentsCountViewlet(self.context, self.request, None, None)

        self.assertIn("http://testblog.disqus.com/count.js",
                      viewlet.get_counter_js())
    def test_correct_js(self):
        """ The Javascript used is generated according to the short name
        """
        viewlet = CommentsCountViewlet(self.context, self.request, None, None)

        self.assertIn("http://testblog.disqus.com/count.js", viewlet.get_counter_js())