Skip to content

Commit 8f35cba

Browse files
committed
test ods file
1 parent f66cba7 commit 8f35cba

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
8.37 KB
Binary file not shown.

simple_import/tests.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ def test_csv(self):
4747
file_data = import_log.get_import_file_as_list(only_header=True)
4848
self.assertIn('name', file_data)
4949

50+
def test_ods(self):
51+
path = os.path.join(
52+
os.path.dirname(__file__), 'static', 'test_import.ods')
53+
with open(path, 'rb') as fp:
54+
import_log = ImportLog.objects.create(
55+
name="test",
56+
user=self.user,
57+
import_file=File(fp),
58+
import_setting=self.import_setting,
59+
import_type='N',
60+
)
61+
file_data = import_log.get_import_file_as_list(only_header=True)
62+
self.assertIn('name', file_data)
63+
5064
def test_import(self):
5165
""" Make sure we can upload the file and match columns """
5266
import_log_ct_id = ContentType.objects.get_for_model(ImportLog).id

0 commit comments

Comments
 (0)