Exemple #1
0
    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_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'])
Exemple #3
0
 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))
Exemple #4
0
 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))
Exemple #5
0
 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))
Exemple #6
0
 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))