def test_yesterday_with_hour_only(self):
     now = datetime.now()
     yesterday = date.today() + timedelta(days=-1)
     result = timeutils.yesterday(6)
     expected = datetime(yesterday.year, yesterday.month, yesterday.day, 6,
                         now.minute, 0)
     self.assertEqual(expected, result)
Exemplo n.º 2
0
 def test_yesterday_with_hour_only(self):
     now = datetime.now()
     yesterday = date.today() + timedelta(days=-1)
     result = timeutils.yesterday(6)
     expected = datetime(yesterday.year, yesterday.month, yesterday.day, 6,
                         now.minute, 0)
     self.assertEqual(expected, result)
 def test_yesterday_with_hour_and_minute(self):
     yesterday = date.today() + timedelta(days=-1)
     result = timeutils.yesterday(18, 56)
     expected = datetime(yesterday.year, yesterday.month, yesterday.day, 18,
                         56, 0)
     self.assertEqual(expected, result)
Exemplo n.º 4
0
 def test_yesterday_with_hour_and_minute(self):
     yesterday = date.today() + timedelta(days=-1)
     result = timeutils.yesterday(18, 56)
     expected = datetime(yesterday.year, yesterday.month, yesterday.day, 18,
                         56, 0)
     self.assertEqual(expected, result)