def METHOD_NAME(dummy_agreement, state, expected):
    dummy_agreement.state = state
    filter_ = Agreement.pending if expected else ~Agreement.pending
    assert dummy_agreement.pending == expected
    assert Agreement.query.filter(filter_).first() == dummy_agreement
    assert not Agreement.query.filter(~filter_).has_rows()