Disable discussion by default.

svn path=/plone.app.discussion/trunk/; revision=46337
This commit is contained in:
Timo Stollenwerk 2010-12-14 17:58:46 +00:00
parent e4e707e350
commit a8bfd7fc6e
7 changed files with 42 additions and 4 deletions

View File

@ -4,6 +4,9 @@ Changelog
1.0RC1 (unreleased)
-------------------
- Disable discussion by default.
[timo]
- Move discussion action item from actionicons.xml to actions.xml to avoid
deprecation warning.
[timo]

View File

@ -29,7 +29,7 @@ class IDiscussionSettings(Interface):
"specific content types, folders or content objects "
"before users will be able to post comments."),
required=False,
default=True,
default=False,
)
anonymous_comments = schema.Bool(

View File

@ -34,6 +34,15 @@ you're not logged in::
>>> unprivileged_browser = Browser(app)
Enable commenting.
>>> from zope.component import queryUtility
>>> from plone.registry.interfaces import IRegistry
>>> from plone.app.discussion.interfaces import IDiscussionSettings
>>> registry = queryUtility(IRegistry)
>>> settings = registry.forInterface(IDiscussionSettings)
>>> settings.globally_enabled = True
Enable comment review workflow
------------------------------

View File

@ -38,6 +38,18 @@ Make sure we have a test user from the layer and it uses fancy characters:
>>> mtool.getMemberById('jim').getProperty('fullname')
'Jim Fult\xc3\xb8rn'
Enable commenting.
>>> from zope.component import queryUtility
>>> from plone.registry.interfaces import IRegistry
>>> from plone.app.discussion.interfaces import IDiscussionSettings
>>> registry = queryUtility(IRegistry)
>>> settings = registry.forInterface(IDiscussionSettings)
>>> settings.globally_enabled = True
>>> import transaction
>>> transaction.commit()
Create a public page with comments allowed.
>>> browser.open(portal_url)

View File

@ -52,7 +52,12 @@ class TestCommentForm(PloneTestCase):
self.memberdata = self.portal.portal_memberdata
self.request = self.app.REQUEST
self.context = getattr(self.portal, 'doc1')
# Allow discussion
registry = queryUtility(IRegistry)
settings = registry.forInterface(IDiscussionSettings)
settings.globally_enabled = True
def test_add_comment(self):
"""Post a comment as logged-in user.
"""
@ -220,6 +225,11 @@ class TestCommentsViewlet(PloneTestCase):
context = getattr(self.portal, 'doc1')
self.viewlet = CommentsViewlet(context, request, None, None)
# Allow discussion
registry = queryUtility(IRegistry)
settings = registry.forInterface(IDiscussionSettings)
settings.globally_enabled = True
def test_cook(self):
text = """First paragraph

View File

@ -46,7 +46,7 @@ class RegistryTest(PloneTestCase):
self.assertEquals(
self.registry['plone.app.discussion.interfaces.' +
'IDiscussionSettings.globally_enabled'],
True)
False)
def test_anonymous_comments(self):
# Check anonymous_comments record

View File

@ -32,7 +32,11 @@ class ConversationTest(PloneTestCase):
self.portal_discussion = getToolByName(self.portal,
'portal_discussion',
None)
# Allow discussion
registry = queryUtility(IRegistry)
settings = registry.forInterface(IDiscussionSettings)
settings.globally_enabled = True
def test_add_comment(self):
# Create a conversation. In this case we doesn't assign it to an
# object, as we just want to check the Conversation object API.