def test_meta_transaction_roundtrip(meta_transaction): dumped = schemas.MetaTransactionSchema().dump(meta_transaction) print("DUMPED", dumped) loaded = schemas.MetaTransactionSchema().load(dumped) print("LOADED", loaded) assert loaded == meta_transaction
def test_load_meta_transaction_valid_values(values): dumped = schemas.MetaTransactionSchema().dump(a_valid_meta_transaction) dumped.update(values) # If the load fails, a `<marshmallow.exceptions.ValidationError>` is raised schemas.MetaTransactionSchema().load(dumped)
def test_load_meta_transaction_invalid_values(values): dumped = schemas.MetaTransactionSchema().dump(a_valid_meta_transaction) dumped.update(values) with pytest.raises(ValidationError): schemas.MetaTransactionSchema().load(dumped)