collection test added.

svn path=/plone.app.discussion/trunk/; revision=35126
This commit is contained in:
Timo Stollenwerk 2010-03-17 15:00:19 +00:00
parent e00453e9d6
commit b70774343f

View File

@ -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__)