Tests for 22dce02bec1e97b00fa5dde2479ab498784a866c..1754473c532d300ce517460d2ff467c312ae5510

This commit is contained in:
Ruediger Pluem 2016-04-05 12:16:23 +02:00
parent 1754473c53
commit 1c48d18d9a

View File

@ -200,6 +200,18 @@ def test_format_date():
format = 'Mon Mar 28 12:37:08 2016, commit 4367aef' format = 'Mon Mar 28 12:37:08 2016, commit 4367aef'
assert i18n.format_date(format, date=date) == format 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(): def test_get_filename_for_language():
app = TestApp() app = TestApp()