def test_get_es_query(self):

    class TestElasticSearchFilter(ElasticSearchFilter):

        def get_es_query(self, s_query, s_fields, **kwargs):
            return Q('match', query=s_query, field=s_fields)
    s_query = 'test'
    s_fields = 'first_name'
    backend = TestElasticSearchFilter()
    result = backend.get_es_query(s_query, s_fields)
    expected = Q('match', query=s_query, field=s_fields)
    assert (result == expected)
def test_get_es_query(self):

    class TestElasticSearchFilter(ElasticSearchFilter):

        def get_es_query(self, s_query, s_fields, **kwargs):
            return Q('match', query=s_query, field=s_fields)
    s_query = 'test'
    s_fields = 'first_name'
    backend = TestElasticSearchFilter()
    result = backend.get_es_query(s_query, s_fields)
    expected = Q('match', query=s_query, field=s_fields)
    assert (result == expected)