MCPcopy
hub / github.com/django/django / test_multiple_units

Method test_multiple_units

tests/utils_tests/test_timesince.py:44–53  ·  view source on GitHub ↗

Test multiple units.

(self)

Source from the content-addressed store, hash-verified

42 self.assertEqual(timesince(self.t, self.t + self.oneyear), "1\xa0year")
43
44 def test_multiple_units(self):
45 """Test multiple units."""
46 self.assertEqual(
47 timesince(self.t, self.t + 2 * self.oneday + 6 * self.onehour),
48 "2\xa0days, 6\xa0hours",
49 )
50 self.assertEqual(
51 timesince(self.t, self.t + 2 * self.oneweek + 2 * self.oneday),
52 "2\xa0weeks, 2\xa0days",
53 )
54
55 def test_display_first_unit(self):
56 """

Callers

nothing calls this directly

Calls 1

timesinceFunction · 0.90

Tested by

no test coverage detected