def g(expect_regexp, *args): with self.assertRaises(ValueError) as cm: Setting._parse_time_range(*args, now=now) if six.PY2: self.assertRegexpMatches(cm.exception.message, expect_regexp) else: self.assertRegex(str(cm.exception), expect_regexp)
def f(has_time, start_year, start_month, start_day, start_hour, start_minute, end_year, end_month, end_day, end_hour, end_minute, *args): self.assertEqual( Setting._parse_time_range(*args, now=now), (EventTime(has_time, self._localize(start_year, start_month, start_day, start_hour, start_minute)), EventTime(has_time, self._localize(end_year, end_month, end_day, end_hour, end_minute))))