diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-04-06 15:36:10 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-04-06 15:36:10 +0200 |
| commit | 860dfb5586d1ed387e25746120568c6d5d8c371f (patch) | |
| tree | 6f061253b989248297e6fa574d34461f9239fe8d /odoo/addons/test_impex | |
| parent | a2165a04c322bb949baa7d8d51ddef1320ed08de (diff) | |
| parent | d277adf4d5995321619f1e0def3119ef0abd98f2 (diff) | |
[MERGE] forward port branch 11.0 up to d277adf4d59
Diffstat (limited to 'odoo/addons/test_impex')
| -rw-r--r-- | odoo/addons/test_impex/tests/test_export.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/odoo/addons/test_impex/tests/test_export.py b/odoo/addons/test_impex/tests/test_export.py index 8009f97adc0..3c48d0e1da4 100644 --- a/odoo/addons/test_impex/tests/test_export.py +++ b/odoo/addons/test_impex/tests/test_export.py @@ -2,6 +2,8 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. import itertools +import unittest +from cProfile import Profile from odoo.tests import common from odoo.tools import pycompat @@ -71,6 +73,16 @@ class test_integer_field(CreatorCase): self.export(2**31-1), [[pycompat.text_type(2**31-1)]]) + @unittest.skip("Only benches/profiles") + def test_xid_perfs(self): + for i in range(10000): + self.make(i) + self.model.invalidate_cache() + records = self.model.search([]) + + p = Profile() + p.runcall(records._export_rows, [['id'], ['value']]) + p.dump_stats('xid_perfs.pstats') class test_float_field(CreatorCase): model_name = 'export.float' @@ -325,11 +337,9 @@ class test_m2o(CreatorCase): record = self.env['export.integer'].create({'value': 42}) # Expecting the m2o target model name in the external id, # not this model's name - external_id = u'__export__.export_integer_%d' % record.id - self.assertEqual( - self.export(record.id, fields=['value/id']), - [[external_id]]) - + self.assertRegexpMatches( + self.export(record.id, fields=['value/id'])[0][0], + u'__export__.export_integer_%d_[0-9a-f]{8}' % record.id) class test_o2m(CreatorCase): model_name = 'export.one2many' |
