import unittest from datetime import datetime, timedelta from plone.registry import Registry from zope.component import createObject, queryUtility from Acquisition import aq_base, aq_parent, aq_inner from OFS.Image import Image from plone.app.vocabularies.types import BAD_TYPES 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