Add new course dates fragment.

Also add it to the course home page.
This commit is contained in:
Diana Huang
2017-04-26 14:16:24 -04:00
committed by Andy Armstrong
parent 97c084514f
commit e12a704cea
23 changed files with 466 additions and 317 deletions

View File

@@ -44,38 +44,38 @@ class TestTimeZoneUtils(TestCase):
self.assertEqual(display_tz_info['abbr'], expected_abbr)
self.assertEqual(display_tz_info['offset'], expected_offset)
@freeze_time("2015-02-09")
def test_display_time_zone_without_dst(self):
"""
Test to ensure get_display_time_zone() returns full display string when no kwargs specified
and returns just abbreviation or offset when specified
"""
tz_info = self._display_time_zone_helper('America/Los_Angeles')
self._assert_time_zone_info_equal(tz_info, 'America/Los Angeles', 'PST', '-0800')
with freeze_time("2015-02-09"):
tz_info = self._display_time_zone_helper('America/Los_Angeles')
self._assert_time_zone_info_equal(tz_info, 'America/Los Angeles', 'PST', '-0800')
@freeze_time("2015-04-02")
def test_display_time_zone_with_dst(self):
"""
Test to ensure get_display_time_zone() returns modified abbreviations and
offsets during daylight savings time.
"""
tz_info = self._display_time_zone_helper('America/Los_Angeles')
self._assert_time_zone_info_equal(tz_info, 'America/Los Angeles', 'PDT', '-0700')
with freeze_time("2015-04-02"):
tz_info = self._display_time_zone_helper('America/Los_Angeles')
self._assert_time_zone_info_equal(tz_info, 'America/Los Angeles', 'PDT', '-0700')
@freeze_time("2015-11-01 08:59:00")
def test_display_time_zone_ambiguous_before(self):
"""
Test to ensure get_display_time_zone() returns correct abbreviations and offsets
during ambiguous time periods (e.g. when DST is about to start/end) before the change
"""
tz_info = self._display_time_zone_helper('America/Los_Angeles')
self._assert_time_zone_info_equal(tz_info, 'America/Los Angeles', 'PDT', '-0700')
with freeze_time("2015-11-01 08:59:00"):
tz_info = self._display_time_zone_helper('America/Los_Angeles')
self._assert_time_zone_info_equal(tz_info, 'America/Los Angeles', 'PDT', '-0700')
@freeze_time("2015-11-01 09:00:00")
def test_display_time_zone_ambiguous_after(self):
"""
Test to ensure get_display_time_zone() returns correct abbreviations and offsets
during ambiguous time periods (e.g. when DST is about to start/end) after the change
"""
tz_info = self._display_time_zone_helper('America/Los_Angeles')
self._assert_time_zone_info_equal(tz_info, 'America/Los Angeles', 'PST', '-0800')
with freeze_time("2015-11-01 09:00:00"):
tz_info = self._display_time_zone_helper('America/Los_Angeles')
self._assert_time_zone_info_equal(tz_info, 'America/Los Angeles', 'PST', '-0800')