Test 'office title' facet & allow no blank choice in facet response.
This commit is contained in:
parent
0657c415b7
commit
9607c30bfa
|
@ -72,7 +72,10 @@ class FacetResponse(object):
|
||||||
|
|
||||||
for choice in facet['choices']:
|
for choice in facet['choices']:
|
||||||
self.choices[choice['v']['v']] = FacetChoice(choice)
|
self.choices[choice['v']['v']] = FacetChoice(choice)
|
||||||
|
if 'blankChoice' in facet:
|
||||||
self.blank_choice = FacetChoice(facet['blankChoice'])
|
self.blank_choice = FacetChoice(facet['blankChoice'])
|
||||||
|
else:
|
||||||
|
self.blank_choice = None
|
||||||
|
|
||||||
|
|
||||||
class FacetsResponse(object):
|
class FacetsResponse(object):
|
||||||
|
|
|
@ -118,6 +118,12 @@ class TutorialTestFacets(RefineTestCase):
|
||||||
ethnicity_facet.reset()
|
ethnicity_facet.reset()
|
||||||
response = self.project.get_rows()
|
response = self.project.get_rows()
|
||||||
self.assertEqual(response.filtered, 6958)
|
self.assertEqual(response.filtered, 6958)
|
||||||
|
# {11}
|
||||||
|
office_title_facet = Facet('Office Title')
|
||||||
|
self.project.engine.add_facet(office_title_facet)
|
||||||
|
response = self.project.text_facet()
|
||||||
|
self.assertEqual(len(response.facets[2].choices), 76)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
Loading…
Reference in New Issue