MCPcopy
hub / github.com/django/django / test_parse_date

Method test_parse_date

tests/utils_tests/test_dateparse.py:14–22  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12
13class DateParseTests(unittest.TestCase):
14 def test_parse_date(self):
15 # Valid inputs
16 self.assertEqual(parse_date("2012-04-23"), date(2012, 4, 23))
17 self.assertEqual(parse_date("2012-4-9"), date(2012, 4, 9))
18 self.assertEqual(parse_date("20120423"), date(2012, 4, 23))
19 # Invalid inputs
20 self.assertIsNone(parse_date("2012423"))
21 with self.assertRaises(ValueError):
22 parse_date("2012-04-56")
23
24 def test_parse_time(self):
25 # Valid inputs

Callers

nothing calls this directly

Calls 2

parse_dateFunction · 0.90
dateFunction · 0.85

Tested by

no test coverage detected