Skip to content

Commit

Permalink
Fixes marshmallow-code#899: Make from_is_date method use isoparse fro…
Browse files Browse the repository at this point in the history
…m dateutils
  • Loading branch information
dushr committed Sep 3, 2018
1 parent 8560ed7 commit 68266b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion marshmallow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def from_iso_time(timestring, use_dateutil=True):

def from_iso_date(datestring, use_dateutil=True):
if dateutil_available and use_dateutil:
return parser.parse(datestring).date()
return parser.isoparse(datestring).date()
else:
return datetime.datetime.strptime(datestring[:10], '%Y-%m-%d').date()

Expand Down
1 change: 1 addition & 0 deletions tests/test_deserialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ def test_date_field_deserialization(self):
'',
123,
[],
dt.date(2014, 8, 21).strftime('%d-%m-%Y'),
],
)
def test_invalid_date_field_deserialization(self, in_value):
Expand Down

0 comments on commit 68266b1

Please sign in to comment.