def test_kickoff_datetime(self): # 2011 - Saturday the 8th (https://en.wikipedia.org/wiki/Logo_Motion) kickoff_2011 = datetime(2011, 1, 8, 10, 30, 00, tzinfo=timezone('EST')) kickoff_2011_utc = kickoff_2011.astimezone(UTC) self.assertEqual(SeasonHelper.kickoff_datetime_est(year=2011), kickoff_2011) self.assertEqual(SeasonHelper.kickoff_datetime_utc(year=2011), kickoff_2011_utc) # 2010 - Saturday the 9th (https://en.wikipedia.org/wiki/Breakaway_(FIRST)) kickoff_2010 = datetime(2010, 1, 9, 10, 30, 00, tzinfo=timezone('EST')) kickoff_2010_utc = kickoff_2010.astimezone(UTC) self.assertEqual(SeasonHelper.kickoff_datetime_est(year=2010), kickoff_2010) self.assertEqual(SeasonHelper.kickoff_datetime_utc(year=2010), kickoff_2010_utc) # 2009 - Saturday the 3rd (https://en.wikipedia.org/wiki/Lunacy_(FIRST) kickoff_2009 = datetime(2009, 1, 3, 10, 30, 00, tzinfo=timezone('EST')) kickoff_2009_utc = kickoff_2009.astimezone(UTC) self.assertEqual(SeasonHelper.kickoff_datetime_est(year=2009), kickoff_2009) self.assertEqual(SeasonHelper.kickoff_datetime_utc(year=2009), kickoff_2009_utc)
def _render(self, *args, **kw): special_webcasts = FirebasePusher.get_special_webcasts() self.template_values.update({ "events": EventHelper.getWeekEvents(), 'kickoff_datetime_utc': SeasonHelper.kickoff_datetime_utc(), "any_webcast_online": any(w.get('status') == 'online' for w in special_webcasts), "special_webcasts": special_webcasts, }) return jinja2_engine.render('index/index_offseason.html', self.template_values)
def _render(self, *args, **kw): special_webcasts = FirebasePusher.get_special_webcasts() effective_season_year = SeasonHelper.effective_season_year() self.template_values.update({ 'events': EventHelper.getWeekEvents(), 'is_kickoff': SeasonHelper.is_kickoff_at_least_one_day_away( year=effective_season_year), 'kickoff_datetime_est': SeasonHelper.kickoff_datetime_est(effective_season_year), 'kickoff_datetime_utc': SeasonHelper.kickoff_datetime_utc(effective_season_year), "any_webcast_online": any(w.get('status') == 'online' for w in special_webcasts), "special_webcasts": special_webcasts, }) return jinja2_engine.render('index/index_kickoff.html', self.template_values)