From ca7752714bf8d113f64b4f651a748840b434da27 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Sun, 31 May 2009 18:14:42 +0000 Subject: [PATCH] remove comment_text index. svn path=/plone.app.discussion/trunk/; revision=27249 --- plone/app/discussion/catalog.py | 4 ---- plone/app/discussion/configure.zcml | 7 +++---- plone/app/discussion/tests/test_indexers.py | 21 +-------------------- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/plone/app/discussion/catalog.py b/plone/app/discussion/catalog.py index 3a5ac3b..bba83ea 100644 --- a/plone/app/discussion/catalog.py +++ b/plone/app/discussion/catalog.py @@ -12,10 +12,6 @@ from plone.app.discussion.interfaces import IComment def comment_title(object): return object.title -@indexer(IComment) -def comment_text(object): - return object.text - @indexer(IComment) def comment_searchable_text(object): return object.title, object.text diff --git a/plone/app/discussion/configure.zcml b/plone/app/discussion/configure.zcml index f2d3e27..a80a6c0 100644 --- a/plone/app/discussion/configure.zcml +++ b/plone/app/discussion/configure.zcml @@ -26,7 +26,7 @@ component=".comment.CommentFactory" name="plone.Comment" /> - + @@ -38,13 +38,13 @@ - + - + - diff --git a/plone/app/discussion/tests/test_indexers.py b/plone/app/discussion/tests/test_indexers.py index fd91684..be579ed 100644 --- a/plone/app/discussion/tests/test_indexers.py +++ b/plone/app/discussion/tests/test_indexers.py @@ -10,7 +10,7 @@ from plone.indexer import indexer from zope.component import provideAdapter -from plone.app.discussion.catalog import comment_title, comment_text, comment_searchable_text +from plone.app.discussion.catalog import comment_title, comment_searchable_text class IndexersTest(PloneTestCase): @@ -42,25 +42,6 @@ class IndexersTest(PloneTestCase): new_id = conversation.addComment(comment) self.assertEquals(comment_title(comment)(), 'Comment 1') - def test_comment_text(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. - conversation = IConversation(self.portal.doc1) - - # Pretend that we have traversed to the comment by aq wrapping it. - conversation = conversation.__of__(self.portal.doc1) - - # Add a comment. Note: in real life, we always create comments via the factory - # to allow different factories to be swapped in - - comment = createObject('plone.Comment') - comment.title = 'Comment 1' - comment.text = 'Comment text' - - new_id = conversation.addComment(comment) - - self.assertEquals(comment_text(comment)(), 'Comment text') - def test_dates(self): # created, modified, effective etc pass