MCPcopy
hub / github.com/django/django / test_display_first_unit

Method test_display_first_unit

tests/utils_tests/test_timesince.py:55–70  ·  view source on GitHub ↗

If the two differing units aren't adjacent, only the first unit is displayed.

(self)

Source from the content-addressed store, hash-verified

53 )
54
55 def test_display_first_unit(self):
56 """
57 If the two differing units aren't adjacent, only the first unit is
58 displayed.
59 """
60 self.assertEqual(
61 timesince(
62 self.t,
63 self.t + 2 * self.oneweek + 3 * self.onehour + 4 * self.oneminute,
64 ),
65 "2\xa0weeks",
66 )
67 self.assertEqual(
68 timesince(self.t, self.t + 4 * self.oneday + 5 * self.oneminute),
69 "4\xa0days",
70 )
71
72 def test_display_second_before_first(self):
73 """

Callers

nothing calls this directly

Calls 1

timesinceFunction · 0.90

Tested by

no test coverage detected