@@ -100,6 +100,16 @@ def test_bad_post_links(hook):
actual = {error.message for error in hook.run(txn)}
assert expected == actual
def test_flagged_txn_not_checked(hook):
keys = iter(METADATA_KEYS)
txn_meta = build_meta(keys, BAD_LINKS)
txn_meta['flag'] = '!'
txn = testutil.Transaction(**txn_meta, postings=[
('Income:Donations', -5, build_meta(keys, BAD_LINKS)),
('Assets:Checking', 5, build_meta(keys, BAD_LINKS)),
])
assert not list(hook.run(txn))
@pytest.mark.parametrize('value', testutil.NON_STRING_METADATA_VALUES)
def test_bad_metadata_type(hook, value):
txn = testutil.Transaction(**{'check': value}, postings=[