def test_attendance_list_sorting(self): """Test sorting of event attendance list.""" e = EventFactory.create(start=START_DT, end=self.single_day_end) AttendanceFactory.create_batch(2, event=e) sorted_list = get_sorted_attendance_list(e) eq_(sorted_list[0], e.owner, 'Owner is not first.') copy_list = sorted_list[1:] sorted(copy_list, key=lambda x: '%s %s' % (x.last_name, x.first_name)) eq_(copy_list, sorted_list[1:], 'List is not properly sorted.')
def test_attendance_list_sorting(self): """Test sorting of event attendance list.""" e = Event.objects.get(slug='test-event') sorted_list = get_sorted_attendance_list(e) eq_(sorted_list[0], e.owner, 'Owner is not first.') copy_list = sorted_list[1:] sorted(copy_list, key=lambda x: '%s %s' % (x.last_name, x.first_name)) eq_(copy_list, sorted_list[1:], 'List is not properly sorted.')