Commit 9d426672 authored by Jérome Perrin's avatar Jérome Perrin

periodicity: test get{Month,Week}DayItemList

parent e027e578
...@@ -593,3 +593,40 @@ class TestPeriodicity(AlarmTestCase): ...@@ -593,3 +593,40 @@ class TestPeriodicity(AlarmTestCase):
self.tic() self.tic()
alarm.setNextAlarmDate(current_date=date) alarm.setNextAlarmDate(current_date=date)
self.assertEqual(alarm.getAlarmDate(),date) self.assertEqual(alarm.getAlarmDate(),date)
def test_week_day_item_list(self):
alarm = self.newAlarm()
self.assertEqual(
[(label.message, label.domain, value)
for (label, value) in alarm.getWeekDayItemList()],
[
('Sunday', 'erp5_ui','Sunday'),
('Monday', 'erp5_ui', 'Monday'),
('Tuesday', 'erp5_ui', 'Tuesday'),
('Wednesday', 'erp5_ui', 'Wednesday'),
('Thursday', 'erp5_ui', 'Thursday'),
('Friday', 'erp5_ui', 'Friday'),
('Saturday', 'erp5_ui', 'Saturday'),
],
)
def test_month_item_list(self):
alarm = self.newAlarm()
self.assertEqual(
[(label.message, label.domain, value)
for (label, value) in alarm.getMonthItemList()],
[
('January', 'erp5_ui', 1),
('February', 'erp5_ui', 2),
('March', 'erp5_ui', 3),
('April', 'erp5_ui', 4),
('May', 'erp5_ui', 5),
('June', 'erp5_ui', 6),
('July', 'erp5_ui', 7),
('August', 'erp5_ui', 8),
('September', 'erp5_ui', 9),
('October', 'erp5_ui', 10),
('November', 'erp5_ui', 11),
('December', 'erp5_ui', 12),
],
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment