Test for ISO dates

This commit is contained in:
MinchinWeb 2021-07-11 13:52:07 -06:00
commit cb0d6f8dd0
2 changed files with 4 additions and 0 deletions

View file

@ -513,6 +513,9 @@ class TestUtils(LoggedTestCase):
d = utils.SafeDatetime(2012, 8, 9)
self.assertEqual(utils.strftime(d, '%-d/%-m/%y'), '9/8/12')
d = utils.SafeDatetime(2021, 1, 8)
self.assertEqual(utils.strftime(d, '%G - %-V - %u'), '2021 - 1 - 5')
# test the output of utils.strftime in a different locale
# Turkish locale
@unittest.skipUnless(locale_available('tr_TR.UTF-8') or

View file

@ -99,6 +99,7 @@ class SafeDatetime(datetime.datetime):
else:
return super().strftime(fmt)
class DateFormatter:
'''A date formatter object used as a jinja filter