def test_stop_build_date(self): # 2019 - Feb 19th, 2019 stop_build_2019 = datetime(2019, 2, 19, 23, 59, 59, tzinfo=timezone('EST')) stop_build_2019_utc = stop_build_2019.astimezone(UTC) self.assertEqual(SeasonHelper.stop_build_datetime_est(year=2019), stop_build_2019) self.assertEqual(SeasonHelper.stop_build_datetime_utc(year=2019), stop_build_2019_utc) # 2018 - Feb 20th, 2018 stop_build_2018 = datetime(2018, 2, 20, 23, 59, 59, tzinfo=timezone('EST')) stop_build_2018_utc = stop_build_2018.astimezone(UTC) self.assertEqual(SeasonHelper.stop_build_datetime_est(year=2018), stop_build_2018) self.assertEqual(SeasonHelper.stop_build_datetime_utc(year=2018), stop_build_2018_utc) # 2017 - Feb 21th, 2017 stop_build_2017 = datetime(2017, 2, 21, 23, 59, 59, tzinfo=timezone('EST')) stop_build_2017_utc = stop_build_2017.astimezone(UTC) self.assertEqual(SeasonHelper.stop_build_datetime_est(year=2017), stop_build_2017) self.assertEqual(SeasonHelper.stop_build_datetime_utc(year=2017), stop_build_2017_utc) # 2016 - Feb 23th, 2016 stop_build_2016 = datetime(2016, 2, 23, 23, 59, 59, tzinfo=timezone('EST')) stop_build_2016_utc = stop_build_2016.astimezone(UTC) self.assertEqual(SeasonHelper.stop_build_datetime_est(year=2016), stop_build_2016) self.assertEqual(SeasonHelper.stop_build_datetime_utc(year=2016), stop_build_2016_utc)
def _render(self, *args, **kw): self.template_values.update({ 'endbuild_datetime_est': SeasonHelper.stop_build_datetime_est(), 'endbuild_datetime_utc': SeasonHelper.stop_build_datetime_utc(), 'events': EventHelper.getWeekEvents(), }) return jinja2_engine.render('index/index_buildseason.html', self.template_values)