Permalink
Browse files

Fixed the stats tests.

  • Loading branch information...
1 parent 9c250a8 commit 6ad2976cd6cb8dec207de5c07bd1c15505463527 @toastdriven toastdriven committed May 10, 2013
Showing with 6 additions and 6 deletions.
  1. +6 −6 tests/solr_tests/tests/solr_backend.py
@@ -317,7 +317,7 @@ def test_clear(self):
def test_search(self):
self.sb.update(self.smmi, self.sample_objs)
self.assertEqual(self.raw_solr.search('*:*').hits, 3)
-
+
self.assertEqual(self.sb.search(''), {'hits': 0, 'results': []})
self.assertEqual(self.sb.search('*:*')['hits'], 3)
self.assertEqual([result.pk for result in self.sb.search('*:*')['results']], ['1', '2', '3'])
@@ -346,11 +346,11 @@ def test_search(self):
self.assertEqual(results['hits'], 3)
self.assertEqual(results['facets']['queries'], {'name:[* TO e]': 3})
- self.assertEqual(self.sb.search('',stats={}),{'hits':0,'results':[]})
- results = self.sb.search('*:*',stats={'foo':['bar']})
- self.assertEqual(results['hits'],3)
- self.assertEqual(results['stats']['queries'],{})
-
+ self.assertEqual(self.sb.search('', stats={}), {'hits':0,'results':[]})
+ results = self.sb.search('*:*', stats={'name':['name']})
+ self.assertEqual(results['hits'], 3)
+ self.assertEqual(results['stats']['name']['count'], 3)
+
self.assertEqual(self.sb.search('', narrow_queries=set(['name:daniel1'])), {'hits': 0, 'results': []})
results = self.sb.search('Index', narrow_queries=set(['name:daniel1']))
self.assertEqual(results['hits'], 1)

0 comments on commit 6ad2976

Please sign in to comment.