summaryrefslogtreecommitdiff
path: root/addons/base_import/tests
diff options
context:
space:
mode:
authorHaresh Shyara <hsh@odoo.com>2017-01-03 09:50:35 +0100
committerNicolas Martinelli <nim@odoo.com>2017-01-03 12:07:47 +0100
commitc02b2ca7d1842e8d405d4ffc20eda71a5b93a172 (patch)
treec144ec9aa2997799b361700ec0947b1652dfe1c9 /addons/base_import/tests
parent4c798a269069e704bc4be38421799969f8ce3f85 (diff)
[IMP] base_import: Improve import preview for related fields
normal mode: Importing only regular/basic fields from source file advanced mode: Importing any related fields from source file(i.e. if detected pattern in header like '<relational_fieldname>/<fname>') - Rename following checkbox "Show all fields for completion (advanced)" in "Show fields of relation fields (advanced)" - If the import file contains a column with a field of a relation field, show the column label in the preview, even if "Show fields of relation fields (advanced)" is not checked > to make it less confusing when importing advanced files (e.g. products with attributes) This is a backport of 1ba4fbe640cf, which was performed due to several tickets mentioning confusion with the new import system.
Diffstat (limited to 'addons/base_import/tests')
-rw-r--r--addons/base_import/tests/test_base_import.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/base_import/tests/test_base_import.py b/addons/base_import/tests/test_base_import.py
index 68a562971c4..6bef004936e 100644
--- a/addons/base_import/tests/test_base_import.py
+++ b/addons/base_import/tests/test_base_import.py
@@ -260,7 +260,7 @@ class TestPreview(TransactionCase):
['qux', '5', '6'],
])
# Ensure we only have the response fields we expect
- self.assertItemsEqual(result.keys(), ['matches', 'headers', 'fields', 'preview', 'headers_type', 'options', 'debug'])
+ self.assertItemsEqual(result.keys(), ['matches', 'headers', 'fields', 'preview', 'headers_type', 'options', 'advanced_mode', 'debug'])
@unittest.skipUnless(can_import('xlrd'), "XLRD module not available")
def test_xls_success(self):
@@ -290,7 +290,7 @@ class TestPreview(TransactionCase):
['qux', '5', '6'],
])
# Ensure we only have the response fields we expect
- self.assertItemsEqual(result.keys(), ['matches', 'headers', 'fields', 'preview', 'headers_type', 'options', 'debug'])
+ self.assertItemsEqual(result.keys(), ['matches', 'headers', 'fields', 'preview', 'headers_type', 'options', 'advanced_mode', 'debug'])
@unittest.skipUnless(can_import('xlrd.xlsx'), "XLRD/XLSX not available")
def test_xlsx_success(self):
@@ -320,7 +320,7 @@ class TestPreview(TransactionCase):
['qux', '5', '6'],
])
# Ensure we only have the response fields we expect
- self.assertItemsEqual(result.keys(), ['matches', 'headers', 'fields', 'preview', 'headers_type', 'options', 'debug'])
+ self.assertItemsEqual(result.keys(), ['matches', 'headers', 'fields', 'preview', 'headers_type', 'options','advanced_mode', 'debug'])
@unittest.skipUnless(can_import('odf'), "ODFPY not available")
def test_ods_success(self):
@@ -350,7 +350,7 @@ class TestPreview(TransactionCase):
['aux', '5', '6'],
])
# Ensure we only have the response fields we expect
- self.assertItemsEqual(result.keys(), ['matches', 'headers', 'fields', 'preview', 'headers_type', 'options', 'debug'])
+ self.assertItemsEqual(result.keys(), ['matches', 'headers', 'fields', 'preview', 'headers_type', 'options', 'advanced_mode', 'debug'])
class test_convert_import_data(TransactionCase):