MCPcopy
hub / github.com/django/django / test_S_format

Method test_S_format

tests/utils_tests/test_dateformat.py:255–265  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

253 )
254
255 def test_S_format(self):
256 for expected, days in [
257 ("st", [1, 21, 31]),
258 ("nd", [2, 22]),
259 ("rd", [3, 23]),
260 ("th", (n for n in range(4, 31) if n not in [21, 22, 23])),
261 ]:
262 for day in days:
263 dt = date(1970, 1, day)
264 with self.subTest(day=day):
265 self.assertEqual(dateformat.format(dt, "S"), expected)
266
267 def test_y_format_year_before_1000(self):
268 tests = [

Callers

nothing calls this directly

Calls 2

dateFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected