def search_tutors(request): tutors_qs = Tutor.objects.none() form = TutorSearchForm(data=request.GET) if form.is_valid(): tutors_qs = form.search() tutors = paginate_queryset(tutors_qs, request.GET) return render(request, "search/search.html", { "form": form, "tutors": tutors })
def test_form_fields(self): FORM_FIELDS = ("name", ) form = TutorSearchForm() self.assertCountEqual(FORM_FIELDS, list(form.fields.keys()))
def test_form_fields(self): form_fields = ("name", ) form = TutorSearchForm() self.assertCountEqual(form_fields, list(form.fields.keys()))