forked from django-import-export/django-import-export
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for the file mode to MediaStorage.read().
- Loading branch information
1 parent
0f86101
commit a6beeef
Showing
5 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
id,name,author_email1,Some book,[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,16 @@ def test_import_dos(self): | |
expected = 'id,name,author_email\n1,Some book,[email protected]\n' | ||
self.assertEqual(in_stream, expected) | ||
|
||
def test_import_mac(self): | ||
filename = os.path.join( | ||
os.path.dirname(__file__), | ||
os.path.pardir, | ||
'exports', | ||
'books-mac.csv') | ||
in_stream = open(filename, self.format.get_read_mode()).read() | ||
expected = 'id,name,author_email\n1,Some book,[email protected]\n' | ||
self.assertEqual(in_stream, expected) | ||
|
||
def test_import_unicode(self): | ||
# importing csv UnicodeEncodeError 347 | ||
filename = os.path.join( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters