Esempio n. 1
0
 def test_viewing_uncommented_item_doesnt_create_talkback(self):
     # make sure we avoid creating unnecessary persistent talkbacks
     self.assertFalse(hasattr(self.portal.document, 'talkback'))
     viewlet = CommentsViewlet(self.portal.document, self.app.REQUEST, None,
                               None)
     viewlet.update()
     viewlet.render()
     self.assertFalse(hasattr(self.portal.document, 'talkback'))
Esempio n. 2
0
    def test_time_render(self):
        request = self.app.REQUEST
        context = self.portal.document
        dtool = getToolByName(context, 'portal_discussion')
        tb = dtool.getDiscussionFor(context)
        reply_id = tb.createReply(title='Subject',
                                  text='Reply text',
                                  Creator='tester')

        viewlet = CommentsViewlet(context, request, None, None)
        viewlet.update()
        time = DateTime('2009/10/20 15:00')
        self.assertEqual(viewlet.format_time(time), 'Oct 20, 2009 03:00 PM')
Esempio n. 3
0
 def _comment_login_url(self):
     viewlet = CommentsViewlet(self.portal.document, self.app.REQUEST, None,
                               None)
     viewlet.update()
     return viewlet.login_url()