hudson buildout added.

svn path=/plone.app.discussion/trunk/; revision=46002
This commit is contained in:
Timo Stollenwerk
2010-11-28 09:51:35 +00:00
parent 549c93af29
commit 7e39197114
5 changed files with 59 additions and 8 deletions
+5 -1
View File
@@ -10,10 +10,13 @@
<five:registerPackage package="." />
<include package="plone.indexer" />
<include package="plone.uuid" />
<include package="plone.app.uuid" />
<include file="permissions.zcml" />
<include file="notifications.zcml" />
<include file="subscribers.zcml" />
<include package=".browser" />
<i18n:registerTranslations directory="locales" />
@@ -43,6 +46,7 @@
<!-- Comments -->
<class class=".comment.Comment">
<implements interface="plone.uuid.interfaces.IAttributeUUID" />
<require interface=".interfaces.IComment" permission="zope2.View" />
<require attributes="Title Creator getId getText" permission="zope2.View" />
</class>
+36 -7
View File
@@ -6,9 +6,10 @@ import logging
import unittest
from zope.component import createObject
from zope.component import getMultiAdapter
from Products.CMFCore.utils import getToolByName
from Products.PloneTestCase.ptc import PloneTestCase
from plone.app.discussion.tests.layer import DiscussionLayer
@@ -26,13 +27,12 @@ class CommentTest(PloneTestCase):
layer = DiscussionLayer
def afterSetUp(self):
"""Create a document.
"""
# First we need to create some content.
self.loginAsPortalOwner()
self.portal.invokeFactory(id='doc1',
title='Document 1',
type_name='Document')
typetool = self.portal.portal_types
typetool.constructContent('Document', self.portal, 'doc1')
self.catalog = getToolByName(self.portal, 'portal_catalog')
def test_factory(self):
comment1 = createObject('plone.Comment')
self.assert_(IComment.providedBy(comment1))
@@ -83,6 +83,35 @@ class CommentTest(PloneTestCase):
conversation.addComment(comment1)
self.assertEquals(u"Tarek Ziadé on Document äüö", comment1.Title())
def test_uid(self):
conversation = IConversation(self.portal.doc1)
comment1 = createObject('plone.Comment')
conversation.addComment(comment1)
comment_brain = self.catalog.searchResults(
portal_type = 'Discussion Item')[0]
self.failUnless(comment_brain.UID)
def test_uid_is_unique(self):
conversation = IConversation(self.portal.doc1)
comment1 = createObject('plone.Comment')
conversation.addComment(comment1)
comment2 = createObject('plone.Comment')
conversation.addComment(comment2)
brains = self.catalog.searchResults(
portal_type = 'Discussion Item')
self.assertNotEquals(brains[0].UID, None)
self.assertNotEquals(brains[1].UID, None)
self.assertNotEquals(brains[0].UID, brains[1].UID)
def test_comment_uid_differs_from_content_uid(self):
conversation = IConversation(self.portal.doc1)
comment1 = createObject('plone.Comment')
conversation.addComment(comment1)
comment_brain = self.catalog.searchResults(
portal_type = 'Discussion Item')[0]
self.assertNotEquals(comment_brain.UID, None)
self.assertNotEquals(self.portal.doc1.UID, comment_brain.UID)
def test_creator(self):
comment1 = createObject('plone.Comment')
comment1.creator = "Jim"