|
1 | 1 | # -*- coding: utf-8 -*-
|
2 | 2 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
|
3 | 3 |
|
4 |
| -from odoo.addons.base.tests.common import HttpCaseWithUserPortal |
| 4 | +from odoo.addons.base.tests.common import HttpCaseWithUserDemo, HttpCaseWithUserPortal |
5 | 5 | from odoo.tests import tagged
|
6 | 6 |
|
7 | 7 |
|
8 | 8 | @tagged('post_install', '-at_install')
|
9 |
| -class TestUi(HttpCaseWithUserPortal): |
| 9 | +class TestUi(HttpCaseWithUserDemo, HttpCaseWithUserPortal): |
| 10 | + |
| 11 | + @classmethod |
| 12 | + def setUpClass(cls): |
| 13 | + super().setUpClass() |
| 14 | + # be sure some expected values are set otherwise homepage may fail |
| 15 | + cls.partner_portal.write({ |
| 16 | + "city": "Bayonne", |
| 17 | + "company_name": "YourCompany", |
| 18 | + "country_id": cls.env.ref("base.us").id, |
| 19 | + "phone": "(683)-556-5104", |
| 20 | + "street": "858 Lynn Street", |
| 21 | + "zip": "07002", |
| 22 | + }) |
| 23 | + |
10 | 24 | def test_01_portal_load_tour(self):
|
11 | 25 | self.start_tour("/", 'portal_load_homepage', login="portal")
|
12 | 26 |
|
13 | 27 | def test_02_portal_load_tour_cant_edit_vat(self):
|
14 |
| - willis = self.env.ref('base.demo_user0') |
15 |
| - willis.parent_id = self.env.ref('base.partner_demo').id |
| 28 | + willis = self.user_portal |
| 29 | + willis.parent_id = self.user_demo.partner_id.id |
16 | 30 | self.start_tour("/", 'portal_load_homepage', login="portal")
|
17 | 31 | self.assertEqual(willis.phone, "+1 555 666 7788")
|
0 commit comments