Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][FIX]hr_holidays_calendar_event_privacy: Fix test in time #113

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from datetime import timedelta

from freezegun import freeze_time

from odoo import fields
from odoo.tests import Form, TransactionCase


@freeze_time("2024-01-01")
class TestHrLeaveCalendarEvent(TransactionCase):
@classmethod
def setUpClass(cls):
Expand All @@ -24,15 +27,15 @@ def _new_leave_request(cls, date_from, date_to):
def test_calendar_event_privacy(self):
self.assertEqual(self.leave_type.calendar_event_privacy, "confidential")
leave = self._new_leave_request(
fields.Date.today() + timedelta(days=12),
fields.Date.today() + timedelta(days=13),
fields.Date.today() + timedelta(days=2),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get why are you changing this data.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, seems reasonable.

fields.Date.today() + timedelta(days=3),
)
leave.action_validate()
self.assertEqual(leave.meeting_id.privacy, "confidential")
self.leave_type.calendar_event_privacy = "public"
leave = self._new_leave_request(
fields.Date.today() + timedelta(days=13),
fields.Date.today() + timedelta(days=14),
fields.Date.today() + timedelta(days=3),
fields.Date.today() + timedelta(days=4),
)
leave.action_validate()
self.assertEqual(leave.meeting_id.privacy, "public")
Loading