def test_last_month_name(self): import calendar m = (datetime.now().month - 2) % 12 + 1 expected = calendar.month_name[m] result = last_month_name() self.assertEqual(expected, result)