| 59 | |
| 60 | # SQLite date bug -- ref #3689 |
| 61 | # cleanup |
| 62 | >>> d.delete() |
| 63 | >>> d2.delete() |
| 64 | >>> d3.delete() |
| 65 | |
| 66 | >>> 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)) |
| 67 | >>> d.save() |
| 68 | >>> d1 = Donut(name='Date Test 2006', baked_date=datetime.datetime(year=2006, month=1, day=1), consumed_at=datetime.datetime(year=2006, month=1, day=1)) |
| 69 | >>> d1.save() |
| 70 | |
| 71 | >>> Donut.objects.get(baked_date__year=2007) |
| 72 | <Donut: Date Test 2007> |
| 73 | |
| 74 | >>> Donut.objects.get(baked_date__year=2006) |
| 75 | <Donut: Date Test 2006> |
| 76 | |
| 77 | >>> Donut.objects.get(consumed_at__year=2007) |
| 78 | <Donut: Date Test 2007> |
| 79 | |
| 80 | >>> Donut.objects.get(consumed_at__year=2006) |
| 81 | <Donut: Date Test 2006> |
| 82 | |
| 83 | >>> d.delete() |
| 84 | >>> d1.delete() |