diff --git a/tests/test_meta_rt_links.py b/tests/test_meta_rt_links.py index 21f4b5692257dbc98489637e9ac184f9ccc0823a..6f95c2e3c5ac8cf187a658a9de42f0d188b4ea12 100644 --- a/tests/test_meta_rt_links.py +++ b/tests/test_meta_rt_links.py @@ -119,6 +119,18 @@ def test_bad_post_links(hook, link_source, format_error): actual = {error.message for error in hook.run(txn)} assert expected == actual +@pytest.mark.parametrize('value', testutil.NON_STRING_METADATA_VALUES) +def test_bad_metadata_type(hook, value): + txn = testutil.Transaction(**{'rt-id': value}, postings=[ + ('Income:Donations', -5), + ('Assets:Cash', 5), + ]) + expected = {'transaction has wrong type of rt-id: expected str but is a {}'.format( + type(value).__name__, + )} + actual = {error.message for error in hook.run(txn)} + assert expected == actual + @pytest.mark.parametrize('ext_doc', [ 'statement.txt', 'https://example.org/',