diff --git a/addons/calendar/tests/test_calendar.py b/addons/calendar/tests/test_calendar.py index 588862399d2..5b43fc2ec06 100644 --- a/addons/calendar/tests/test_calendar.py +++ b/addons/calendar/tests/test_calendar.py @@ -5,6 +5,7 @@ import datetime from datetime import date, datetime, timedelta from odoo import fields, Command +from odoo.addons.base.tests.common import HttpCaseWithUserDemo from odoo.tests import Form, HttpCase, tagged from odoo.addons.base.tests.common import SavepointCaseWithUserDemo @@ -440,7 +441,7 @@ class TestCalendar(SavepointCaseWithUserDemo): }) self.assertTrue(set(new_partners) == set(self.event_tech_presentation.videocall_channel_id.channel_partner_ids.ids), 'new partners must be invited to the channel') @tagged('post_install', '-at_install') -class TestCalendarTours(HttpCase): +class TestCalendarTours(HttpCaseWithUserDemo): def test_calendar_month_view_start_hour_displayed(self): """ Test that the time is displayed in the month view. """ self.start_tour("/web", 'calendar_appointments_hour_tour', login="demo") @@ -473,7 +474,7 @@ class TestCalendarTours(HttpCase): Check that we can decline events. """ user_admin = self.env.ref('base.user_admin') - user_demo = self.env.ref('base.user_demo') + user_demo = self.user_demo start = datetime.combine(date.today(), datetime.min.time()).replace(hour=9) stop = datetime.combine(date.today(), datetime.min.time()).replace(hour=12) event = self.env['calendar.event'].with_user(user_admin).create({ @@ -498,7 +499,7 @@ class TestCalendarTours(HttpCase): Check that we can decline events with the "Everybody's calendars" filter. """ user_admin = self.env.ref('base.user_admin') - user_demo = self.env.ref('base.user_demo') + user_demo = self.user_demo start = datetime.combine(date.today(), datetime.min.time()).replace(hour=9) stop = datetime.combine(date.today(), datetime.min.time()).replace(hour=12) event = self.env['calendar.event'].with_user(user_admin).create({ diff --git a/addons/google_calendar/tests/test_sync_google2odoo.py b/addons/google_calendar/tests/test_sync_google2odoo.py index 4459d3763a2..33fe0de68b4 100644 --- a/addons/google_calendar/tests/test_sync_google2odoo.py +++ b/addons/google_calendar/tests/test_sync_google2odoo.py @@ -21,6 +21,10 @@ class TestSyncGoogle2Odoo(TestSyncGoogle): 'email': 'public_email@example.com', 'type': 'contact', }) + self.env.ref('base.partner_admin').write({ + 'name': 'Mitchell Admin', + 'email': 'admin@yourcompany.example.com', + }) self.private_partner = self.env['res.partner'].create({ 'name': 'Private Contact', 'email': 'private_email@example.com', diff --git a/addons/google_calendar/tests/test_sync_odoo2google.py b/addons/google_calendar/tests/test_sync_odoo2google.py index 461b0463a2b..6dcefb737d6 100644 --- a/addons/google_calendar/tests/test_sync_odoo2google.py +++ b/addons/google_calendar/tests/test_sync_odoo2google.py @@ -19,6 +19,7 @@ class TestSyncOdoo2Google(TestSyncGoogle): def setUp(self): super().setUp() + self.env.user.partner_id.tz = "Europe/Brussels" self.google_service = GoogleCalendarService(self.env['google.service']) # Make sure this test will work for the next 30 years self.env['ir.config_parameter'].set_param('google_calendar.sync.range_days', 10000) @@ -123,7 +124,7 @@ class TestSyncOdoo2Google(TestSyncGoogle): 'res_id': partner.id, }) - with self.assertQueryCount(__system__=32): + with self.assertQueryCount(__system__=37): event.unlink() def test_event_without_user(self):