def test_numeric_type(self): vv1 = compute_virtual_value(kv_type=NUMERIC, kv_format='dddd', value='4500') vv2 = compute_virtual_value(kv_type=NUMERIC, kv_format='dddd', value='4600') self.assertTrue(vv2 > vv1, f"Assertion {vv2} > {vv1} failed.")
def test_date_type(self): vv1 = compute_virtual_value(kv_type=DATE, kv_format='dd.mm.yy', value='04.05.20') vv2 = compute_virtual_value(kv_type=DATE, kv_format='dd.mm.yy', value='05.06.20') self.assertTrue(vv2 > vv1, f"Assertion {vv2} > {vv1} failed.")
def test_empty_date_type(self): vv1 = compute_virtual_value( kv_type=DATE, kv_format='dd.mm.yy', value='' # empty date ) vv2 = compute_virtual_value(kv_type=DATE, kv_format='dd.mm.yy', value=None) # in both cases virtual value is expected to be 0 self.assertEqual(vv1, 0) self.assertEqual(vv2, 0)
def test_money_type(self): vv1 = compute_virtual_value(kv_type=MONEY, kv_format='dd.cc', value='45.06') vv2 = compute_virtual_value(kv_type=MONEY, kv_format='dd.cc', value='60.20') self.assertTrue(vv2 > vv1, f"Assertion {vv2} > {vv1} failed.") vv1 = compute_virtual_value(kv_type=MONEY, kv_format='dd,cc', value='45.00') vv2 = compute_virtual_value(kv_type=MONEY, kv_format='dd,cc', value='46.00') self.assertTrue(vv2 > vv1, f"Assertion {vv2} > {vv1} failed.")