Fix TextFilterFacet and make query most important option.

This commit is contained in:
Paul Makepeace 2011-04-26 18:56:59 -04:00
parent a34c8c72c9
commit b23147ce48
2 changed files with 5 additions and 3 deletions

View File

@ -36,9 +36,9 @@ class Facet(object):
class TextFilterFacet(Facet):
def __init__(self, column, query):
super(TextFacet, self).__init__(column, type='text', mode='text',
query=query, **options)
def __init__(self, column, query, **options):
super(TextFilterFacet, self).__init__(column, query=query, type='text',
mode='text', **options)
class TextFacet(Facet):

View File

@ -49,6 +49,8 @@ class FacetTest(unittest.TestCase):
facet = FlaggedFacet(False)
self.assertEqual(facet.selection[0]['v']['v'], False)
self.assertRaises(ValueError, FlaggedFacet, 'false') # no strings
facet = TextFilterFacet('column name', 'query')
self.assertEqual(facet.query, 'query')
def test_selections(self):
facet = TextFacet('column name')