diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2018-12-17 13:28:03 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2018-12-17 13:37:32 +0000 |
| commit | dc9e87baa6930b4b628dcd4dbaf20e1f8b959c62 (patch) | |
| tree | 6909db3ea53094cade3b525c1e9284e8909e3255 | |
| parent | 8a1f9f09c299a180adbcd0b3e167d2b70e2348b8 (diff) | |
[FIX] test_impex: use context provided
The `export` method accepts a `context` parameter, but doesn't use it.
This actually hides an incorrect test: when exporting in French, `Bar`
should be exported as `titi`.
| -rw-r--r-- | odoo/addons/test_impex/tests/test_export.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/odoo/addons/test_impex/tests/test_export.py b/odoo/addons/test_impex/tests/test_export.py index f44da3ef838..1239436839c 100644 --- a/odoo/addons/test_impex/tests/test_export.py +++ b/odoo/addons/test_impex/tests/test_export.py @@ -20,11 +20,11 @@ class CreatorCase(common.TransactionCase): super(CreatorCase, self).setUp() self.model = self.env[self.model_name] - def make(self, value): - return self.model.create({'value': value}) + def make(self, value, context=None): + return self.model.with_context(**(context or {})).create({'value': value}) def export(self, value, fields=('value',), context=None): - record = self.make(value) + record = self.make(value, context=context) record.invalidate_cache() return record._export_rows([f.split('/') for f in fields]) @@ -291,7 +291,7 @@ class test_selection(CreatorCase): }) self.assertEqual( self.export(2, context={'lang': 'fr_FR'}), - [[u'Bar']]) + [[u'titi']]) class test_selection_function(CreatorCase): |
