collection test added (failing).

svn path=/plone.app.discussion/trunk/; revision=33780
This commit is contained in:
Timo Stollenwerk
2010-02-05 22:40:38 +00:00
parent 89a9d879f4
commit 2ffbe75611
2 changed files with 24 additions and 6 deletions
+15 -1
View File
@@ -186,7 +186,7 @@ class CommentCatalogTest(PloneTestCase):
def afterSetUp(self):
# First we need to create some content.
self.loginAsPortalOwner()
typetool = self.portal.portal_types
self.typetool = typetool = self.portal.portal_types
typetool.constructContent('Document', self.portal, 'doc1')
self.catalog = getToolByName(self.portal, 'portal_catalog')
@@ -294,5 +294,19 @@ class CommentCatalogTest(PloneTestCase):
self.failUnless(brains)
self.assertEquals(len(brains), 6)
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')
query = topic.buildQuery()
self.assertEquals(len(query), 1)
self.assertEquals(query['type_crit'], ('Comment',))
# XXX: FAIL
#self.assertEquals(len(topic.queryCatalog()), 1)
def test_suite():
return unittest.defaultTestLoader.loadTestsFromName(__name__)