diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0b7bb8bce880f5885aca5243dd1365a9a4015a27 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_event_creation diff --git a/tests/test_event_creation.py b/tests/test_event_creation.py new file mode 100644 index 0000000000000000000000000000000000000000..f74115d404d1039f096e5d9dcd0263ddc7d19395 --- /dev/null +++ b/tests/test_event_creation.py @@ -0,0 +1,33 @@ +# © 2019 Le Filament (<http://www.le-filament.com>) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import random +import logging + +from odoo.tests import tagged, common + +_logger = logging.getLogger(__name__) + + +@tagged('post_install', '-at_install') +class TestEventCreation(common.TransactionCase): + + def setUp(self): + super(TestEventCreation, self).setUp() + + self.CalendarEvent = self.env['calendar.event'] + + def test_calender_simple_event(self): + m = self.CalendarEvent.create({ + 'name': "Test compute", + 'start': '2017-07-12 14:30:00', + 'allday': False, + 'stop': '2017-07-12 15:00:00', + 'user_id': 180 + }) + + self.assertEqual( + (m.ur_id), + (m.user_id.partner_id.ur_id), + "Event UR check" + )