Fixed #21523 - support for mock dates in DateField.to_python()

In cases where the value passed in to the DateField.to_python() method
is a real date, and datetime.date is being mocked out, the method would
raise an error attempting to call parse_date on the mock object (as the
parsing requires a string input). I’ve added in a duck-type check for
objects before the parse_date call - if the object has a ‘isoformat()’
method, then call this, and pass it into the parse_date function - which
should return an identical object.
None of our tests use mock currently so we'd have to add that as a dependency which I'm not sure is ideal. One idea would be to use unittest.mock if provides the same or similar functionality (available in Python 3.3+ and perhaps we could vendor it in django.utils for 3.2 and 2.7)