From 328f59231c084c8cee8777b7a27c6f4449006977 2021-02-11 16:17:24 From: Brett Smith Date: 2021-02-11 16:17:24 Subject: [PATCH] meta_tax_implication: Accept titlecased values. --- diff --git a/conservancy_beancount/plugin/meta_tax_implication.py b/conservancy_beancount/plugin/meta_tax_implication.py index 8a4a82974f781e6e3f6607803a83741d6b94f1e5..b0b6c4c18ec513311dea3cbf62d1b17d6887d857 100644 --- a/conservancy_beancount/plugin/meta_tax_implication.py +++ b/conservancy_beancount/plugin/meta_tax_implication.py @@ -26,6 +26,9 @@ def _make_aliases(s: str, stdname: Optional[str]=None) -> Iterator[Tuple[str, st elif s != stdname: yield (s, stdname) yield (s.lower(), stdname) + title_s = s.title() + if s != title_s: + yield (title_s, stdname) if s.startswith('1099-'): yield from _make_aliases(f'1099{s[5:]}', stdname) elif s.startswith('USA-'): diff --git a/tests/test_meta_tax_implication.py b/tests/test_meta_tax_implication.py index 520092db0fc82f4ec25202fafae3992a1e62cb54..c4a306fcb72b18d547ff45adf4a427561c48e4ce 100644 --- a/tests/test_meta_tax_implication.py +++ b/tests/test_meta_tax_implication.py @@ -15,7 +15,7 @@ VALID_VALUES = { '1099': '1099-NEC', '1099-NEC': '1099-NEC', '1099nec': '1099-NEC', - '1099-MISC-Other': '1099-MISC-Other', + '1099-Misc-Other': '1099-MISC-Other', '1099misc-other': '1099-MISC-Other', 'Bank-Transfer': 'Bank-Transfer', 'Chargeback': 'Chargeback',