def test_list_selected_facets(self): fsv = FacetedSearchView() fsv.request = HttpRequest() fsv.request.GET = QueryDict('') fsv.form = fsv.build_form() self.assertEqual(fsv.form.selected_facets, []) fsv = FacetedSearchView() fsv.request = HttpRequest() fsv.request.GET = QueryDict('selected_facets=author:daniel&selected_facets=author:chris') fsv.form = fsv.build_form() self.assertEqual(fsv.form.selected_facets, [u'author:daniel', u'author:chris'])
def test_default_form(self): fsv = FacetedSearchView() fsv.request = HttpRequest() fsv.request.GET = QueryDict('') fsv.form = fsv.build_form() self.assert_(isinstance(fsv.form, FacetedSearchForm))
def test_empty_results(self): fsv = FacetedSearchView() fsv.request = HttpRequest() fsv.request.GET = QueryDict('') fsv.form = fsv.build_form() self.assert_(isinstance(fsv.get_results(), EmptySearchQuerySet))
def test_default_form(self): fsv = FacetedSearchView() fsv.request = HttpRequest() fsv.request.GET = QueryDict('') fsv.form = fsv.build_form() self.assertTrue(isinstance(fsv.form, FacetedSearchForm))
def test_empty_results(self): fsv = FacetedSearchView() fsv.request = HttpRequest() fsv.request.GET = QueryDict('') fsv.form = fsv.build_form() self.assertTrue(isinstance(fsv.get_results(), EmptySearchQuerySet))