From cc58a91eed328bf981d3657a5c0f2b929f0ff13c Mon Sep 17 00:00:00 2001
From: Benjamin <benjamin@le-filament.com>
Date: Wed, 22 Jul 2020 18:39:51 +0200
Subject: [PATCH] [add] unit test files

---
 tests/__init__.py            |  3 +++
 tests/test_event_creation.py | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 tests/__init__.py
 create mode 100644 tests/test_event_creation.py

diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..0b7bb8b
--- /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 0000000..f74115d
--- /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"
+        )
-- 
GitLab