revert r46002.

svn path=/plone.app.discussion/trunk/; revision=46003
This commit is contained in:
Timo Stollenwerk 2010-11-28 10:00:31 +00:00
parent 7e39197114
commit b08d7ddbeb
5 changed files with 8 additions and 59 deletions

View File

@ -4,10 +4,6 @@ Changelog
1.0RC1 (unreleased)
-------------------
- Make sure comment UIDs in the catalog are always unique. This fixes
http://dev.plone.org/plone/ticket/10652.
[timo]
- Fix 'check all' on batch moderation page.
[davisagli]

View File

@ -1,13 +0,0 @@
[buildout]
extends =
buildout.cfg
http://svn.plone.org/svn/collective/buildout/hudson/hudson.cfg
package-name = plone.app.discussion
package-directories = .
jstestdriver-directories =
plone/app/discussion
browsers =
/usr/bin/firefox

View File

@ -10,13 +10,10 @@
<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" />
@ -46,7 +43,6 @@
<!-- 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>

View File

@ -6,9 +6,8 @@ import logging
import unittest
from zope.component import createObject
from zope.component import getMultiAdapter
from Products.CMFCore.utils import getToolByName
from zope.component import getMultiAdapter
from Products.PloneTestCase.ptc import PloneTestCase
@ -27,11 +26,12 @@ class CommentTest(PloneTestCase):
layer = DiscussionLayer
def afterSetUp(self):
# First we need to create some content.
"""Create a document.
"""
self.loginAsPortalOwner()
typetool = self.portal.portal_types
typetool.constructContent('Document', self.portal, 'doc1')
self.catalog = getToolByName(self.portal, 'portal_catalog')
self.portal.invokeFactory(id='doc1',
title='Document 1',
type_name='Document')
def test_factory(self):
comment1 = createObject('plone.Comment')
@ -83,35 +83,6 @@ 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"

View File

@ -26,7 +26,6 @@ setup(name='plone.app.discussion',
'collective.monkeypatcher',
'plone.app.layout',
'plone.app.registry',
'plone.app.uuid',
'plone.app.z3cform',
'plone.indexer',
'plone.registry',