summaryrefslogtreecommitdiff
path: root/odoo/addons/base/tests/test_form_create.py
diff options
context:
space:
mode:
authorRomainLibert <rli@odoo.com>2019-10-11 11:47:41 +0000
committerfw-bot <otis@odoo.com>2019-10-17 14:51:47 +0000
commit1802a1cbc428f4fe4540a61f0a5c1765a82de874 (patch)
treea39f8a205e17167599c4c8a15755e69449fc7c49 /odoo/addons/base/tests/test_form_create.py
parent1c5b6a6b5d3c2ada9ba10f89134bf2893bf01644 (diff)
[IMP] base: add tests to create basic records using Form tool
Purpose ======= It sometimes happens that the last runbot build is green, but it's impossible to create a basic record (a new user for example) in the interface. This commit adds new tests using the Form tool (so triggering the onchanges, and so on), to check that those basic models can be instanciated without any issue on the interface. closes odoo/odoo#38962 Taskid: 2070350 X-original-commit: e6d8c471c036a35b2c86f91d0053435f468c0ab8 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'odoo/addons/base/tests/test_form_create.py')
-rw-r--r--odoo/addons/base/tests/test_form_create.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/odoo/addons/base/tests/test_form_create.py b/odoo/addons/base/tests/test_form_create.py
new file mode 100644
index 00000000000..54757b68c57
--- /dev/null
+++ b/odoo/addons/base/tests/test_form_create.py
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+from odoo.tests import TransactionCase, tagged, Form
+
+
+@tagged('-at_install', 'post_install')
+class TestFormCreate(TransactionCase):
+ """
+ Test that the basic Odoo models records can be created on
+ the interface.
+ """
+
+ def test_create_res_partner(self):
+ partner_form = Form(self.env['res.partner'])
+ partner_form.name = 'a partner'
+ partner_form.save()
+
+ def test_create_res_users(self):
+ user_form = Form(self.env['res.users'])
+ user_form.login = 'a user login'
+ user_form.name = 'a user name'
+ user_form.save()
+
+ def test_create_res_company(self):
+ company_form = Form(self.env['res.company'])
+ company_form.name = 'a company'
+ company_form.save()
+
+ def test_create_res_group(self):
+ group_form = Form(self.env['res.groups'])
+ group_form.name = 'a group'
+ group_form.save()
+
+ def test_create_res_bank(self):
+ bank_form = Form(self.env['res.bank'])
+ bank_form.name = 'a bank'
+ bank_form.save()
+
+ def test_create_res_country(self):
+ country_form = Form(self.env['res.country'])
+ country_form.name = 'a country'
+ country_form.save()
+
+ def test_create_res_lang(self):
+ lang_form = Form(self.env['res.lang'])
+ lang_form.name = 'a lang name'
+ lang_form.code = 'a lang code'
+ lang_form.save()