Ticket #12059: 12059.diff
File 12059.diff, 1.4 KB (added by , 15 years ago) |
---|
-
django/db/models/fields/__init__.py
835 835 # Not usually a good idea to pass in a datetime here (it loses 836 836 # information), but this can be a side-effect of interacting with a 837 837 # database backend (e.g. Oracle), so we'll be accommodating. 838 return value.time 838 return value.time() 839 839 840 840 # Attempt to parse a datetime: 841 841 value = smart_str(value) -
tests/regressiontests/datatypes/models.py
58 58 >>> d3.consumed_at 59 59 datetime.datetime(2007, 4, 20, 16, 19, 59) 60 60 61 # Test for ticket #12059: TimeField wrongly handling datetime.datetime object. 62 63 >>> d2.baked_time = datetime.datetime(year=2007, month=4, day=20, hour=16, minute=19, second=59) 64 >>> d2.save() 65 66 >>> d3 = Donut.objects.all()[0] 67 >>> d3.baked_time 68 datetime.time(16, 19, 59) 69 61 70 # Year boundary tests (ticket #3689) 62 71 63 72 >>> d = Donut(name='Date Test 2007', baked_date=datetime.datetime(year=2007, month=12, day=31), consumed_at=datetime.datetime(year=2007, month=12, day=31, hour=23, minute=59, second=59))