From 6cd5702379daec9a570d3fb07cfcccee5c1720b9 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Fri, 11 Sep 2009 08:55:37 +0000
Subject: [PATCH] getAlarmDate used to fail when PeriodicityStartDate was not
 defined. This was fixed in 20288.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28928 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testAlarm.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/product/ERP5/tests/testAlarm.py b/product/ERP5/tests/testAlarm.py
index f1853f93e8..d814d0ef32 100644
--- a/product/ERP5/tests/testAlarm.py
+++ b/product/ERP5/tests/testAlarm.py
@@ -687,6 +687,20 @@ class TestAlarm(ERP5TypeTestCase):
     alarm.setProperty('bogus', None)
     self.assertEquals(alarm.getProperty('bogus', None), None)
 
+  def test_20_UndefinedPeriodicityStartDate(self, quiet=0, run=run_all_test):
+    """
+    Test that getAlarmDate does not crash when PeriodicityStartDate is not set.
+    """
+    if not run: return
+    if not quiet:
+      message = 'Test undefined PeriodicityStartDate'
+      ZopeTestCase._print('\n%s ' % message)
+      LOG('Testing... ',0,message)
+    alarm = self.newAlarm()
+    # Test sanity check.
+    self.assertEqual(alarm.getPeriodicityStartDate(), None)
+    # Actual test.
+    self.assertEquals(alarm.getAlarmDate(), None)
 
 def test_suite():
   suite = unittest.TestSuite()
-- 
2.30.9