Skip to content

Commit

Permalink
[FIX] crm_salesperson_planner: Fix tests (Add freeze_time decorator t…
Browse files Browse the repository at this point in the history
…o make it more resilient)

Fixes #589
  • Loading branch information
victoralmau committed Jul 26, 2024
1 parent d44849d commit 4a546b6
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
from datetime import timedelta

from freezegun import freeze_time

from odoo import exceptions, fields
from odoo.tests import common
from odoo.tools import mute_logger
Expand Down Expand Up @@ -194,6 +196,7 @@ def test_04_cancel_visit(self):
first_visit.unlink()
self.assertEqual(len(visit_template.visit_ids), 9)

@freeze_time("2024-01-01 08:00")
def test_05_repeat_weeks(self):
self.visit_template_base.write(
{
Expand All @@ -220,6 +223,7 @@ def test_05_repeat_weeks(self):
fields.Date.from_string("2024-07-02"),
)

@freeze_time("2024-01-01 08:00")
def test_06_repeat_months_count_01(self):
self.visit_template_base.write(
{
Expand Down Expand Up @@ -248,6 +252,7 @@ def test_06_repeat_months_count_01(self):
fields.Date.from_string("2024-05-01"),
)

@freeze_time("2024-01-01 08:00")
def test_06_repeat_months_count_02(self):
self.visit_template_base.write(
{
Expand Down Expand Up @@ -276,6 +281,7 @@ def test_06_repeat_months_count_02(self):
fields.Date.from_string("2024-05-01"),
)

@freeze_time("2024-01-01 08:00")
def test_06_repeat_months_count_03(self):
self.visit_template_base.write(
{
Expand Down Expand Up @@ -305,6 +311,7 @@ def test_06_repeat_months_count_03(self):
fields.Date.from_string("2024-05-06"),
)

@freeze_time("2024-01-01 08:00")
def test_07_repeat_yearly_count_01(self):
self.visit_template_base.write(
{
Expand Down

0 comments on commit 4a546b6

Please sign in to comment.