collection test added.
svn path=/plone.app.discussion/trunk/; revision=35126
This commit is contained in:
parent
e00453e9d6
commit
b70774343f
@ -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__)
|
Loading…
Reference in New Issue
Block a user