diff options
| author | Claude Paroz <claude@2xlibre.net> | 2019-10-19 14:59:50 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2019-10-19 15:05:46 +0200 |
| commit | 44f43516a582f500cda3b37dbab9faa247d3f3f1 (patch) | |
| tree | 3efeee27c6885683e904d365412cc1f34c4bb71d /tests/test_tablib.py | |
| parent | e0a40577fdf371096b6d557a0db6dafdde5542c6 (diff) | |
| download | tablib-44f43516a582f500cda3b37dbab9faa247d3f3f1.tar.gz | |
Refs #250 - Test that commas embedded in quoted strings can be imported
Diffstat (limited to 'tests/test_tablib.py')
| -rwxr-xr-x | tests/test_tablib.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_tablib.py b/tests/test_tablib.py index c872e81..186d83e 100755 --- a/tests/test_tablib.py +++ b/tests/test_tablib.py @@ -625,6 +625,16 @@ class CSVTests(BaseTestCase): self.assertEqual(_csv, data.csv) + def test_csv_import_set_commas_embedded(self): + """Comma-separated CSV can include commas inside quoted string.""" + csv_text = ( + 'id,name,description,count\r\n' + '12,Smith,"Red, rounded",4\r\n' + ) + data.csv = csv_text + self.assertEqual(data[0][2], 'Red, rounded') + self.assertEqual(data.csv, csv_text) + def test_csv_import_set_with_unicode_str(self): """Import CSV set with non-ascii characters in unicode literal""" csv_text = ( |
