def test_num_months_difference_two_years(self): date1 = datetime.date(2022, 1, 18) date2 = datetime.date(2020, 1, 18) difference = utils.num_months_difference(date1, date2) self.assertEqual(difference, 24)
def test_num_months_difference_same_month(self): date1 = datetime.date(2020, 1, 31) date2 = datetime.date(2020, 1, 1) difference = utils.num_months_difference(date1, date2) self.assertEqual(difference, 0)
def test_num_months_difference_one_week(self): date1 = datetime.date(2020, 2, 5) date2 = datetime.date(2020, 1, 28) difference = utils.num_months_difference(date1, date2) self.assertEqual(difference, 0)