From: Mauro Scomparin Date: Mon, 16 Sep 2019 20:51:41 +0000 (+0200) Subject: nuovo test X-Git-Url: https://git.scompo.it/?a=commitdiff_plain;h=f52169afd8d9be915f3818c345c9790878efb6e3;p=money.git nuovo test --- diff --git a/money/tests/test_money.py b/money/tests/test_money.py index e91163d..017cedb 100644 --- a/money/tests/test_money.py +++ b/money/tests/test_money.py @@ -100,7 +100,7 @@ class MoneyTest(unittest.TestCase): self.assertEqual(res[2]['prog'], 3) self.assertEqual(res[3]['prog'], 4) - def test_mov_filter(self): + def test_mov_filter_match(self): m = { money.TYPE_FIELD_NAME: '-', money.VALUE_FIELD_NAME: '100', @@ -112,6 +112,18 @@ class MoneyTest(unittest.TestCase): res = money.mov_filter(ms, 't') self.assertEqual(len(res), 1) + def test_mov_filter_no_match(self): + m = { + money.TYPE_FIELD_NAME: '-', + money.VALUE_FIELD_NAME: '100', + money.DATE_FIELD_NAME: '18/04/2017', + money.HOUR_FIELD_NAME: '00:01', + money.DESCRIPTION_FIELD_NAME: 'test', + } + ms = [m] + res = money.mov_filter(ms, 'a') + self.assertEqual(len(res), 0) + def create_test_movement(date, hour, prog): return {