Beispiel #1
0
 def testGeneric(self):
   """Generic datetime from now."""
   for n in range(-2, 3): # [-2, 2]
     for f in (d, h, m, s):
       td = f(n)
       dt = self.now + td
       self.assertEquals(pdt(dt), ptd(td))
Beispiel #2
0
 def testSpecificDatetime(self):
   """Specific datetime from now."""
   self.assertEquals(pdt(self.now+timedelta(5)), "in 5 days")
   self.assertEquals(pdt(self.now-timedelta(5)), "5 days ago")