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): class TextFilterFacet(Facet):
def __init__(self, column, query): def __init__(self, column, query, **options):
super(TextFacet, self).__init__(column, type='text', mode='text', super(TextFilterFacet, self).__init__(column, query=query, type='text',
query=query, **options) mode='text', **options)
class TextFacet(Facet): class TextFacet(Facet):

View File

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