diff options
author | Ruediger Pluem <r.pluem@gmx.de> | 2016-04-05 12:16:23 +0200 |
---|---|---|
committer | Ruediger Pluem <r.pluem@gmx.de> | 2016-04-05 12:20:10 +0200 |
commit | 1c48d18d9a554a25a57da489d4da48c10baedfb3 (patch) | |
tree | fdb674a934b62b17a39d8c9e983333797af9e678 /tests/test_util_i18n.py | |
parent | 1754473c532d300ce517460d2ff467c312ae5510 (diff) | |
download | sphinx-git-1c48d18d9a554a25a57da489d4da48c10baedfb3.tar.gz |
Tests for 22dce02bec1e97b00fa5dde2479ab498784a866c..1754473c532d300ce517460d2ff467c312ae5510
Diffstat (limited to 'tests/test_util_i18n.py')
-rw-r--r-- | tests/test_util_i18n.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_util_i18n.py b/tests/test_util_i18n.py index 5a54cbb80..6ff988c81 100644 --- a/tests/test_util_i18n.py +++ b/tests/test_util_i18n.py @@ -200,6 +200,18 @@ def test_format_date(): format = 'Mon Mar 28 12:37:08 2016, commit 4367aef' assert i18n.format_date(format, date=date) == format + format = '%B %d, %Y, %H:%M:%S %I %p' + datet = datetime.datetime(2016, 2, 7, 5, 11, 17, 0) + assert i18n.format_date(format, date=datet) == 'February 07, 2016, 05:11:17 05 AM' + + format = '%x' + assert i18n.format_date(format, date=datet) == 'Feb 7, 2016' + format = '%X' + assert i18n.format_date(format, date=datet) == '5:11:17 AM' + assert i18n.format_date(format, date=date) == 'Feb 7, 2016' + format = '%c' + assert i18n.format_date(format, date=datet) == 'Feb 7, 2016, 5:11:17 AM' + assert i18n.format_date(format, date=date) == 'Feb 7, 2016' def test_get_filename_for_language(): app = TestApp() |