def test_Empty( self ): from Products.CMFTopic.Topic import Topic topic = Topic('top') query = topic.buildQuery() self.assertEqual( len( query ), 0 )
def test_Simple( self ): from Products.CMFTopic.Topic import Topic topic = Topic('top') topic.addCriterion( 'foo', 'String Criterion' ) topic.getCriterion( 'foo' ).edit( 'bar' ) query = topic.buildQuery() self.assertEqual( len(query), 1 ) self.assertEqual( query['foo'], 'bar' ) topic.addCriterion( 'baz', 'Integer Criterion' ) topic.getCriterion( 'baz' ).edit( 43 ) query = topic.buildQuery() self.assertEqual( len( query ), 2 ) self.assertEqual( query[ 'foo' ], 'bar' ) self.assertEqual( query[ 'baz' ], 43 )