

def test_bool_and_bool():
    (qt1, qt2, qt3) = (query.Match(f=1), query.Match(f=2), query.Match(f=3))
    q1 = query.Bool(must=[qt1], should=[qt2])
    q2 = query.Bool(must_not=[qt3])
    assert ((q1 & q2) == query.Bool(must=[qt1], must_not=[qt3], should=[qt2], minimum_should_match=0))
    q1 = query.Bool(must=[qt1], should=[qt1, qt2])
    q2 = query.Bool(should=[qt3])
    assert ((q1 & q2) == query.Bool(must=[qt1, qt3], should=[qt1, qt2], minimum_should_match=0))

dataset/ETHPy150Open elastic/elasticsearch-dsl-py/test_elasticsearch_dsl/test_query.py test_bool_and_bool/original