diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-10-19 18:09:53 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-10-19 18:09:53 +0200 |
| commit | 6466aa499fc37bba5f4feeeecac99448ef88e62e (patch) | |
| tree | 53e8748a67a3ea0cd698ed5498b2578ef9c93202 /addons/website | |
| parent | c27d8715af41815d0f1bd4f88df0de084071aca8 (diff) | |
| parent | 00f45470da533f7fd22542a1b4993c19a19859d4 (diff) | |
[MERGE] forward port branch saas-12 up to 00f4547
Diffstat (limited to 'addons/website')
| -rw-r--r-- | addons/website/tests/test_views.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/addons/website/tests/test_views.py b/addons/website/tests/test_views.py index 5199b8b9f46..1d963c68026 100644 --- a/addons/website/tests/test_views.py +++ b/addons/website/tests/test_views.py @@ -139,6 +139,24 @@ class TestViewSaving(common.TransactionCase): Company = self.env['res.company'] View = self.env['ir.ui.view'] + # create a view with an xmlid, like the file import would + with self.env.norecompute(): + self.view_id = View.create(self.cr, self.uid, { + 'name': "Test View", + 'type': 'qweb', + 'arch': ET.tostring(self.arch, encoding='utf-8').decode('utf-8') + }) + imd = self.env['ir.model.data'].create({ + 'module': 'website', + 'name': 'test_view', + 'model': 'ir.ui.view', + 'res_id': self.view_id, + }) + + # the xml_id of the view should not be flagged as 'noupdate' + self.assertEqual(View.browse(self.cr, self.uid, self.view_id).model_data_id, imd) + self.assertFalse(imd.noupdate) + replacement = ET.tostring(h.DIV( h.H3("Column 2"), h.UL( @@ -149,6 +167,9 @@ class TestViewSaving(common.TransactionCase): ), encoding='utf-8') self.view_id.save(value=replacement, xpath='/div/div[2]') + # the xml_id of the view should be flagged as 'noupdate' + self.assertTrue(imd.noupdate) + company = Company.browse(1) self.assertEqual(company.name, "Acme Corporation") self.assertEqual(company.phone, "+12 3456789") |
