From 1a1c903086caa4d3230575d7aead3ab657b44b56 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 22 Jan 2010 12:29:26 +0000 Subject: [PATCH] Integration test for comments viewlet added. Empty test class for comment form added. svn path=/plone.app.discussion/trunk/; revision=33271 --- .../discussion/tests/test_comments_viewlet.py | 76 ++++++++++++++++++- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/plone/app/discussion/tests/test_comments_viewlet.py b/plone/app/discussion/tests/test_comments_viewlet.py index 5d0b0b3..2007215 100644 --- a/plone/app/discussion/tests/test_comments_viewlet.py +++ b/plone/app/discussion/tests/test_comments_viewlet.py @@ -16,13 +16,85 @@ from plone.registry.interfaces import IRegistry from Products.CMFCore.FSImage import FSImage from Products.CMFCore.utils import getToolByName from Products.CMFPlone.tests import dummy +from Products.Five.testbrowser import Browser from Products.PloneTestCase.ptc import PloneTestCase +from Products.PloneTestCase.ptc import FunctionalTestCase + from plone.app.discussion.browser.comments import CommentsViewlet from plone.app.discussion.interfaces import IConversation, IComment, IReplies, IDiscussionSettings from plone.app.discussion.tests.layer import DiscussionLayer +class TestCommentForm(PloneTestCase): + + layer = DiscussionLayer + + def afterSetUp(self): + self.loginAsPortalOwner() + typetool = self.portal.portal_types + typetool.constructContent('Document', self.portal, 'doc1') + self.portal_discussion = getToolByName(self.portal, 'portal_discussion', None) + self.membership_tool = getToolByName(self.folder, 'portal_membership') + self.memberdata = self.portal.portal_memberdata + request = self.app.REQUEST + context = getattr(self.portal, 'doc1') + self.viewlet = CommentsViewlet(context, request, None, None) + + from z3c.form.testing import TestRequest + request = TestRequest(form={ + 'form.widgets.title': u'bar', + 'form.widgets.text': u'foo',} + ) + #from plone.app.discussion.browser.comments import CommentForm + #cf = CommentForm(self.portal, request) + # Zope publisher uses Python list to mark