def test_stop_build_date(self): # 2019 - Feb 19th, 2019 stop_build_2019 = datetime(2019, 2, 19, 23, 59, 59) self.assertEqual(SeasonHelper.stop_build_date(year=2019), stop_build_2019) # 2018 - Feb 20th, 2018 stop_build_2018 = datetime(2018, 2, 20, 23, 59, 59) self.assertEqual(SeasonHelper.stop_build_date(year=2018), stop_build_2018) # 2017 - Feb 21th, 2017 stop_build_2017 = datetime(2017, 2, 21, 23, 59, 59) self.assertEqual(SeasonHelper.stop_build_date(year=2017), stop_build_2017) # 2016 - Feb 23th, 2016 stop_build_2016 = datetime(2016, 2, 23, 23, 59, 59) self.assertEqual(SeasonHelper.stop_build_date(year=2016), stop_build_2016)
def _render(self, *args, **kw): endbuild_datetime_est = datetime.datetime.strptime( self.template_values['build_season_end'], "%Y-%m-%dT%H:%M:%S" ) if 'build_season_end' in self.template_values else SeasonHelper.stop_build_date() endbuild_datetime_utc = pytz.utc.localize( endbuild_datetime_est + datetime.timedelta(hours=5)) week_events = EventHelper.getWeekEvents() self.template_values.update({ 'endbuild_datetime_est': endbuild_datetime_est, 'endbuild_datetime_utc': endbuild_datetime_utc, 'events': week_events, }) path = os.path.join(os.path.dirname(__file__), "../templates/index_buildseason.html") return template.render(path, self.template_values)