Commit d4f0a6ba authored by Sebastien Robin's avatar Sebastien Robin

check alarm reindexing when periodicity start date is None at

initial indexing

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36992 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b097cbd4
...@@ -749,6 +749,22 @@ class TestAlarm(ERP5TypeTestCase): ...@@ -749,6 +749,22 @@ class TestAlarm(ERP5TypeTestCase):
catalog_alarm_date = alarm_list[0].alarm_date catalog_alarm_date = alarm_list[0].alarm_date
self.assertEqual(date.toZone('UTC'), catalog_alarm_date) self.assertEqual(date.toZone('UTC'), catalog_alarm_date)
def test_21b_AlarmCatalogPresenceWithInitialEmptyStartDate(self):
"""Check that alarm date is properly stored in catalog if
initially the periodicity start date was not there and
then set later"""
date = DateTime().earliestTime()
alarm = self.newAlarm(enabled=True, periodicity_start_date=None)
transaction.commit()
self.tic()
alarm_list = alarm.Alarm_zGetAlarmDate(uid=alarm.getUid())
self.assertEqual(None, alarm_list[0].alarm_date)
alarm.edit(periodicity_start_date=date)
transaction.commit()
self.tic()
alarm_list = alarm.Alarm_zGetAlarmDate(uid=alarm.getUid())
self.assertEqual(date.toZone('UTC'), alarm_list[0].alarm_date)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestAlarm)) suite.addTest(unittest.makeSuite(TestAlarm))
......
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