Open Guibod opened 7 years ago
I've stumble on this annoying bug here on python 3.4.
import unittest from scorched.search import SolrSearch class TestOptionsMethodWipesPivots(unittest.TestCase): def test_there_is_a_problem_with_pivot_by_with_facet(self): facet = 'facet' pivot = 'pivot' search = SolrSearch(None) search = search.facet_by(facet, mincount=1).pivot_by([pivot, facet], mincount=1) self.assertIn(pivot, search.pivoter.fields) self.assertEqual(search.pivoter.fields[pivot], {'mincount': 1}) self.assertIn(facet, search.pivoter.fields) self.assertEqual(search.pivoter.fields[facet], {'mincount': 1}) options = search.options() self.assertIn('facet.pivot', options) self.assertEqual(options['facet.pivot'], 'facet,pivot') self.assertIn(pivot, search.pivoter.fields) # Equals True self.assertEqual(search.pivoter.fields[pivot], {'mincount': 1}) self.assertIn(facet, search.pivoter.fields) self.assertEqual(search.pivoter.fields[facet], {'mincount': 1}) def test_there_is_a_problem_with_pivot_by_even_without_facet(self): facet = 'facet' pivot = 'pivot' search = SolrSearch(None) search = search.pivot_by([pivot, facet], mincount=1) self.assertIn(pivot, search.pivoter.fields) self.assertEqual(search.pivoter.fields[pivot], {'mincount': 1}) self.assertIn(facet, search.pivoter.fields) self.assertEqual(search.pivoter.fields[facet], {'mincount': 1}) options = search.options() self.assertIn('facet.pivot', options) self.assertEqual(options['facet.pivot'], 'facet,pivot') # Equals True self.assertIn(pivot, search.pivoter.fields) self.assertEqual(search.pivoter.fields[pivot], {'mincount': 1}) self.assertIn(facet, search.pivoter.fields) self.assertEqual(search.pivoter.fields[facet], {'mincount': 1})
I've stumble on this annoying bug here on python 3.4.