def test_widget_solr_count(self):
     """ Test facet extraction from solr response
     """
     data = {'index': 'tags'}
     widget = CountableWidget(self.portal, self.request, data=data)
     dummyresponse = DummySolrResponse({'tags': {'foo': 10, 'bar': 7}})
     self.assertEqual(widget.count(dummyresponse),
                      {'': 1, 'all': 1, u'bar': 7, u'foo': 10})
Ejemplo n.º 2
0
 def test_widget_solr_count(self):
     """ Test facet extraction from solr response
     """
     data = {'index': 'tags'}
     widget = CountableWidget(self.portal, self.request, data=data)
     dummyresponse = DummySolrResponse({'tags': {'foo': 10, 'bar': 7}})
     self.assertEqual(widget.count(dummyresponse), {
         '': 1,
         'all': 1,
         u'bar': 7,
         u'foo': 10
     })
 def test_widget_empty_count(self):
     """ Empty count
     """
     data = {}
     widget = CountableWidget(self.portal, self.request, data=data)
     self.assertEqual(widget.count([]), {})
Ejemplo n.º 4
0
 def test_widget_empty_count(self):
     """ Empty count
     """
     data = {}
     widget = CountableWidget(self.portal, self.request, data=data)
     self.assertEqual(widget.count([]), {})