Fixed a weekday numbering problem in a test.
- Legacy-Id: 10359
This commit is contained in:
parent
7161a72f66
commit
f60fe7ceab
|
@ -252,8 +252,9 @@ class MainTestCase(TestCase):
|
||||||
def test_get_times(self):
|
def test_get_times(self):
|
||||||
meeting = make_meeting_test_data()
|
meeting = make_meeting_test_data()
|
||||||
timeslot = meeting.timeslot_set.filter(type='session').first()
|
timeslot = meeting.timeslot_set.filter(type='session').first()
|
||||||
day = timeslot.time.weekday() + 2 # add 2 to match django __week_day filter
|
day = (timeslot.time.weekday() + 1) % 7 + 1 # fix up to match django __week_day filter
|
||||||
times = get_times(meeting,day)
|
times = get_times(meeting,day)
|
||||||
values = [ x[0] for x in times ]
|
values = [ x[0] for x in times ]
|
||||||
self.assertTrue(times)
|
self.assertTrue(times)
|
||||||
self.assertTrue(timeslot.time.strftime('%H%M') in values)
|
self.assertTrue(timeslot.time.strftime('%H%M') in values)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue