diff --git a/tests/test_lcl_processor.py b/tests/test_lcl_processor.py index ceb2962..c910944 100644 --- a/tests/test_lcl_processor.py +++ b/tests/test_lcl_processor.py @@ -46,6 +46,16 @@ class LclLineTestCase(unittest.TestCase): result_date = LclLine(transaction).get_date() self.assertEqual(result_date, expected_date) + def test_get_date_with_transaction_name_wrong_date(self): + transaction = OfxTransaction( + dtposted=datetime.datetime(2020, 1, 23, 1, 2, 3), + name=" CB IKEA 25/25/25", + ) + expected_date = "2020-01-23" + + result_date = LclLine(transaction).get_date() + self.assertEqual(result_date, expected_date) + def test_get_amount_positive(self): transaction = OfxTransaction(trnamt=52.2) expected_amount = 52200 diff --git a/tests/test_ofx_base_line.py b/tests/test_ofx_base_line.py new file mode 100644 index 0000000..ce56dc5 --- /dev/null +++ b/tests/test_ofx_base_line.py @@ -0,0 +1,10 @@ +from ofx_processor.utils.base_ofx import OfxBaseLine +from tests.utils import OfxTransaction + + +def test_name(): + name = "VIR INST" + transaction = OfxTransaction(name=name) + + result_name = OfxBaseLine(transaction).get_payee() + assert result_name == name