def test_multiple_filter_queryset(self, lookups, context, valid_query,
                                      es_dsl_queryset):
        fld = FilteringFilterField(lookups=lookups,
                                   field_name=self.test_field_name)

        qs = fld.prepare_queryset(es_dsl_queryset, context)
        assert qs.to_dict() == {'query': {'bool': {'filter': valid_query}}}
    def test_range_queryset(self, lookup, context, valid_query,
                            es_dsl_queryset):
        fld = FilteringFilterField(lookups=lookup,
                                   field_name=self.test_field_name)

        qs = fld.prepare_queryset(es_dsl_queryset, context)
        assert qs.to_dict() == {"query": {"range": valid_query}}
    def test_no_lookups(self):
        fld = FilteringFilterField(field_name=self.test_field_name)

        assert fld._name == self.test_field_name
        assert len(fld.lookups) == 0
    def test_invalid_data_for_lookups(self, lookups, context, es_dsl_queryset):
        fld = FilteringFilterField(lookups=lookups,
                                   field_name=self.test_field_name)

        qs = fld.prepare_queryset(es_dsl_queryset, context)
        assert qs.to_dict() == {}