MCPcopy
hub / github.com/django/django / test_date_objects

Method test_date_objects

tests/utils_tests/test_timesince.py:140–146  ·  view source on GitHub ↗

Both timesince and timeuntil should work on date objects (#17937).

(self)

Source from the content-addressed store, hash-verified

138 self.assertEqual(timeuntil(now_tz, now_tz_i), "0\xa0minutes")
139
140 def test_date_objects(self):
141 """
142 Both timesince and timeuntil should work on date objects (#17937).
143 """
144 today = datetime.date.today()
145 self.assertEqual(timesince(today + self.oneday), "0\xa0minutes")
146 self.assertEqual(timeuntil(today - self.oneday), "0\xa0minutes")
147
148 def test_both_date_objects(self):
149 """Timesince should work with both date objects (#9672)"""

Callers

nothing calls this directly

Calls 2

timesinceFunction · 0.90
timeuntilFunction · 0.90

Tested by

no test coverage detected