From b70774343f71952dca1f0f5a3fb2ecb361e5b68b Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Wed, 17 Mar 2010 15:00:19 +0000 Subject: [PATCH] collection test added. svn path=/plone.app.discussion/trunk/; revision=35126 --- plone/app/discussion/tests/test_catalog.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/plone/app/discussion/tests/test_catalog.py b/plone/app/discussion/tests/test_catalog.py index 8f1d221..921c318 100644 --- a/plone/app/discussion/tests/test_catalog.py +++ b/plone/app/discussion/tests/test_catalog.py @@ -313,16 +313,14 @@ class CommentCatalogTest(PloneTestCase): def test_collection(self): self.typetool.constructContent('Topic', self.portal, 'topic') topic = self.portal.topic - topic.addCriterion('type_crit', 'ATPortalTypeCriterion') - self.failUnless('crit__type_crit_ATPortalTypeCriterion' in topic) - topic.getCriterion('type_crit_ATPortalTypeCriterion').setValue('Comment') - + crit = topic.addCriterion('Type', 'ATSimpleStringCriterion') + crit.setValue('Discussion Item') query = topic.buildQuery() - self.assertEquals(len(query), 1) - self.assertEquals(query['type_crit'], ('Comment',)) - # XXX: FAIL - #self.assertEquals(len(topic.queryCatalog()), 1) + # Make sure the comment we just added is returned by the collection + self.assertEquals(len(query), 1) + self.assertEquals(query['Type'], 'Discussion Item') + self.assertEquals(len(topic.queryCatalog()), 1) def test_suite(): return unittest.defaultTestLoader.loadTestsFromName(__name__) \ No newline at end of file