def test_exclude(): s = Search() s = s.exclude("match", title="python") assert { "query": { "bool": { "filter": [{ "bool": { "must_not": [{ "match": { "title": { "query": "python" } } }] } }] } } } == s.to_dict()
def test_exclude(self): s = Search() s = s.exclude("match", title="python") self.assertEqual( { "query": { "bool": { "filter": [{ "bool": { "must_not": [{ "match": { "title": { "query": "python" } } }] } }] } } }, s.to_dict(), )