Commit 134cf080 authored by Julien Muchembled's avatar Julien Muchembled

Fix testAlarm

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39996 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent be7cf76e
...@@ -67,6 +67,9 @@ class TestAlarm(ERP5TypeTestCase): ...@@ -67,6 +67,9 @@ class TestAlarm(ERP5TypeTestCase):
def getTitle(self): def getTitle(self):
return "Alarm" return "Alarm"
def getBusinessTemplateList(self):
return ('erp5_base',)
def afterSetUp(self): def afterSetUp(self):
# add a dummy mailhost to capture alarm notifications # add a dummy mailhost to capture alarm notifications
if 'MailHost' in self.portal.objectIds(): if 'MailHost' in self.portal.objectIds():
...@@ -76,11 +79,7 @@ class TestAlarm(ERP5TypeTestCase): ...@@ -76,11 +79,7 @@ class TestAlarm(ERP5TypeTestCase):
self.login() self.login()
def beforeTearDown(self): def beforeTearDown(self):
transaction.commit()
self.getActivityTool().manageClearActivities()
transaction.commit()
del self.portal.MailHost._message_list[:] del self.portal.MailHost._message_list[:]
ERP5TypeTestCase.beforeTearDown(self)
def newAlarm(self, **kw): def newAlarm(self, **kw):
""" """
...@@ -600,7 +599,7 @@ class TestAlarm(ERP5TypeTestCase): ...@@ -600,7 +599,7 @@ class TestAlarm(ERP5TypeTestCase):
elif m.method_id == sense_method_id: elif m.method_id == sense_method_id:
self.assertEqual(expected_tag, m.activity_kw.get('tag')) self.assertEqual(expected_tag, m.activity_kw.get('tag'))
else: else:
raise AssertionError, m.method_id self.fail(m.method_id)
# execute alarm sense script and check tags # execute alarm sense script and check tags
self.getActivityTool().manageInvoke(alarm.getPhysicalPath(),sense_method_id) self.getActivityTool().manageInvoke(alarm.getPhysicalPath(),sense_method_id)
transaction.commit() transaction.commit()
...@@ -611,7 +610,8 @@ class TestAlarm(ERP5TypeTestCase): ...@@ -611,7 +610,8 @@ class TestAlarm(ERP5TypeTestCase):
elif m.method_id == 'immediateReindexObject': elif m.method_id == 'immediateReindexObject':
self.assertEqual(expected_tag, m.activity_kw.get('tag')) self.assertEqual(expected_tag, m.activity_kw.get('tag'))
else: else:
raise AssertionError, m.method_id self.fail(m.method_id)
self.tic()
def test_19_ManualInvocation(self, quiet=0, run=run_all_test): def test_19_ManualInvocation(self, quiet=0, run=run_all_test):
""" """
......
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