nuovo test
authorMauro Scomparin <scompo@gmail.com>
Mon, 16 Sep 2019 20:51:41 +0000 (22:51 +0200)
committerMauro Scomparin <scompo@gmail.com>
Mon, 16 Sep 2019 20:51:41 +0000 (22:51 +0200)
money/tests/test_money.py

index e91163dc129ea77c4938355dfe198f25541c901f..017cedbf2a6a3ce0e6be8432e596b0c003b7926e 100644 (file)
@@ -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 {