def test_signed_on_behalf(dummy_agreement, state, expected): dummy_agreement.state = state assert dummy_agreement.signed_on_behalf == expected assert Agreement.find_one(signed_on_behalf=expected) == dummy_agreement
def test_pending(dummy_agreement, state, expected): dummy_agreement.state = state filter_ = Agreement.pending if expected else ~Agreement.pending assert dummy_agreement.pending == expected assert Agreement.find_one(filter_) == dummy_agreement assert not Agreement.find_first(~filter_)
def test_rejected(dummy_agreement, state, expected): dummy_agreement.state = state assert dummy_agreement.rejected == expected assert Agreement.find_one(rejected=expected) == dummy_agreement
def test_accepted(dummy_agreement, state, expected): dummy_agreement.state = state assert dummy_agreement.accepted == expected assert Agreement.find_one(accepted=expected) == dummy_agreement