Home | History | Annotate | Download | only in test

Lines Matching refs:date

1 """Test date/time type.
17 from datetime import date, datetime
127 # Base clase for testing a particular aspect of timedelta, time, date and
496 # date tests
503 dt = date(2000, 1, 2)
531 class SubclassDate(date):
538 theclass = date
549 # Verify dt -> string -> date identity.
572 # if we're checking something fancier than a date, verify
715 # delta - date is senseless.
717 # mixing date and (delta or date) via * or // is senseless
724 # date + date is senseless
1027 # This still errors, because date and datetime comparison raise
1040 # But date and datetime comparison return NotImplemented instead if the
1440 # has that date lacks.
1564 t.toordinal() - date(t.year, 1, 1).toordinal() + 1,
1575 date(t.year, 1, 1).toordinal() + 1)
1586 self.assertEqual(dt.date(), date(2002, 3, 4))
1590 d = date(2002, 3, 4)
1597 dt = combine(time=t, date=d)
1600 self.assertEqual(d, dt.date())
1602 self.assertEqual(dt, combine(dt.date(), dt.time()))
1608 self.assertRaises(TypeError, combine, "date", "time") # wrong types
2550 d = date(2002, 3, 4)
2559 self.assertEqual(dt.date(), date(2002, 3, 4))
2569 nowaware = self.theclass.combine(now.date(), timeaware)
2787 self.assertEqual(d.toordinal() - date(1, 1, 1).toordinal() + 1,
2892 date(), dt.date())
2902 self.assertEqual(got.date(), expected.date())
3103 if dt.date() == dston.date() and dt.hour == 2:
3127 if dt.date() == dstoff.date() and dt.hour == 0:
3268 self.assertRaises(TypeError, Eastern.fromutc, date.today()) # wrong type
3327 # Trying to compare a date to a datetime should act like a mixed-
3328 # type comparison, despite that datetime is a subclass of date.
3329 as_date = date.today()
3344 # Neverthelss, comparison should work with the base-class (date)
3345 # projection if use of a date method is forced.
3351 # And date should compare with other subclasses of date. If a