def test_should_use_last_day_of_month_for_dates_without_day( self, date_string, date_formats, expected_year, expected_month ): self.given_now(2014, 8, 12) self.when_date_is_parsed_with_formats(date_string, date_formats) self.then_date_was_parsed() self.then_parsed_period_is('month') self.then_parsed_date_is(datetime(year=expected_year, month=expected_month, day=get_last_day_of_month(expected_year, expected_month)))