Skip to content

Commit

Permalink
[FIX] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cvinh committed May 26, 2024
1 parent 9680348 commit 0f342dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion calendar_event_link_project_task/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import models
from . import tests
1 change: 0 additions & 1 deletion calendar_event_link_project_task/tests/__init__.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
from odoo.tests.common import TransactionCase


class TestCalendarEventLink(TransactionCase):
class TestCalendarTaskLink(TransactionCase):
def setUp(self):
super(TestCalendarEventLink, self).setUp()
super(TestCalendarTaskLink, self).setUp()
self.task = self.env["project.task"].search([], limit=1)

def test_calendar_event_link(self):
calendar_event_link_action = self.task.action_show_events()
def test_calendar_task_link(self):
calendar_task_link_action = self.task.action_show_events()
event = (
self.env["calendar.event"]
.with_context(calendar_event_link_action["context"])
.with_context(**calendar_task_link_action["context"])
.create(
{
"name": "event",
"name": "task",
"start": "2019-10-29 10:00:00",
"stop": "2019-10-29 11:00:00",
}
)
)
self.assertEqual(self.task.event_count, 1)
self.assertEqual(
self.env["calendar.event"].search(calendar_event_link_action["domain"]),
self.env["calendar.event"].search(calendar_task_link_action["domain"]),
event,
)

0 comments on commit 0f342dd

Please sign in to comment.