[FIX] calendar: test was trying to send mails for past events

Before this commit, the test was trying to send mail for a past event.
It would fail with the following error:

```
FAIL: TestCalendar.test_event_creation_mail
Traceback (most recent call last):
  File "/data/build/odoo/addons/calendar/tests/test_calendar.py", line 329, in test_event_creation_mail
    _test_one_mail_per_attendee(self, partners)
  File "/data/build/odoo/addons/calendar/tests/test_calendar.py", line 311, in _test_one_mail_per_attendee
    self.assertEqual(len(mail), 1)
AssertionError: 0 != 1
```

https://runbot.odoo.com/web/#id=29871&view_type=form&model=runbot.build.error&menu_id=405&cids=1

closes odoo/odoo#141411

X-original-commit: 2b0bedf5a57ca2733501359fb8cc8e5bc743a4fa
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
This commit is contained in:
Arnaud Joset
2023-11-07 23:57:45 +00:00
parent a5f00ac011
commit 080688868e
+4
View File
@@ -7,6 +7,8 @@ from datetime import date, datetime, timedelta
from odoo import fields, Command
from odoo.tests import Form, HttpCase, tagged
from odoo.addons.base.tests.common import SavepointCaseWithUserDemo
import freezegun
import pytz
import re
@@ -296,8 +298,10 @@ class TestCalendar(SavepointCaseWithUserDemo):
self.assertEqual(str(activity_id.date_deadline), '2018-10-16')
@freezegun.freeze_time('2023-10-06 10:00:00')
def test_event_creation_mail(self):
"""
Freezegun used because we don't send mail for past events
Check that mail are sent to the attendees on event creation
Check that mail are sent to the added attendees on event edit
Check that mail are NOT sent to the attendees when the event date is past