Pass a datetime.date
in the first_date
value:
form = TestForm("name": "John",
"first_date": datetime.date(year=2005, month=1, day=23)})
Or, if you have a date string, convert it to datetime
by using strprime()
:
form = TestForm("name": "John",
"first_date": datetime.datetime.strptime('2005-01-23', '%Y-%m-%d')})
Don't forget to import datetime
.
Hope that helps.