summaryrefslogtreecommitdiff
path: root/addons/event/tests
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-01-20 10:35:24 +0000
committerThibault Delavallée <tde@odoo.com>2020-01-28 10:54:46 +0000
commit3b1c2566ed7ae9a4e7c71533a5ecd8e60c15ad44 (patch)
tree4dcc9f844f18a65ff4895a297bc1075e5479e448 /addons/event/tests
parent8bc9d7710434df4732bb452bb9efac1fd091ee31 (diff)
[FIX] event: copy event type mail scheduling only if activated
Currently when changing category of an event, its category mail scheduling is copied onto the event even if the category does not enforce its use. We have to check the category use_mail_schedule field before computing the new event mail schedulers. In this commit we also lessen default schedulers from 3 to 2 in order to still help people using them without bloating too much event creation. LINKS Task ID 2177281 (support tickets directly in event) Prepares Community PR odoo/odoo#43488 Closes Community PR odoo/odoo#44066
Diffstat (limited to 'addons/event/tests')
-rw-r--r--addons/event/tests/test_event_internals.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/event/tests/test_event_internals.py b/addons/event/tests/test_event_internals.py
index 2a79086808a..874422c1eac 100644
--- a/addons/event/tests/test_event_internals.py
+++ b/addons/event/tests/test_event_internals.py
@@ -99,14 +99,15 @@ class TestEventData(TestEventCommon):
@users('user_eventmanager')
@mute_logger('odoo.models.unlink')
- def test_event_type_configuration(self):
+ def test_event_configuration_from_type(self):
self.assertEqual(self.env.user.tz, 'Europe/Brussels')
event_type = self.event_type_complex.with_user(self.env.user)
event_type.write({
'use_mail_schedule': False,
})
- # self.assertEqual(event_type.event_type_mail_ids, self.env['event.type.mail']) # TDE FIXME: currently crashing
+ # Event type does not use mail schedule but data is kept for compatibility and avoid recreating them
+ self.assertEqual(len(event_type.event_type_mail_ids), 2)
event = self.env['event.event'].create({
'name': 'Event Update Type',
@@ -132,7 +133,7 @@ class TestEventData(TestEventCommon):
self.assertTrue(event.auto_confirm)
self.assertEqual(event.twitter_hashtag, event_type.default_hashtag)
self.assertFalse(event.is_online)
- # self.assertEqual(event.event_mail_ids, self.env['event.mail']) # TDE FIXME: currently crashing
+ self.assertEqual(event.event_mail_ids, self.env['event.mail'])
event_type.write({
'use_mail_schedule': True,