diff options
| author | Sam <sam@basx.dev> | 2020-10-27 11:12:14 +0700 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-11-12 12:43:06 +0100 |
| commit | 895f6e49925ed0ae4bb96dc4d3af17fdc9c4846e (patch) | |
| tree | d8d0facf3bd5698ae8b2fdb46953d90853b76e8b /tests/utils_tests/test_dateformat.py | |
| parent | c448e614c60cc97c6194c62052363f4f501e0953 (diff) | |
Fixed #32149 -- Added support for years < 1000 to DateFormat.y().
Diffstat (limited to 'tests/utils_tests/test_dateformat.py')
| -rw-r--r-- | tests/utils_tests/test_dateformat.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/utils_tests/test_dateformat.py b/tests/utils_tests/test_dateformat.py index d050ac4352..5eb166e2bd 100644 --- a/tests/utils_tests/test_dateformat.py +++ b/tests/utils_tests/test_dateformat.py @@ -165,3 +165,16 @@ class DateFormatTests(SimpleTestCase): dateformat.format(dt, 'r'), 'Sun, 08 Jul 1979 22:00:00 +0100', ) + + def test_year_before_1000(self): + tests = [ + (476, '76'), + (42, '42'), + (4, '04'), + ] + for year, expected_date in tests: + with self.subTest(year=year): + self.assertEqual( + dateformat.format(datetime(year, 9, 8, 5, 0), 'y'), + expected_date, + ) |
