mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Test to reproduce an issue that occurs with python3.3 under macos10 only
This test passes fine under linux
This commit is contained in:
parent
34ef5ab098
commit
fd7cb9e213
1 changed files with 19 additions and 0 deletions
|
|
@ -458,6 +458,25 @@ class TestDateFormatter(unittest.TestCase):
|
|||
locale.setlocale(locale.LC_ALL, '')
|
||||
|
||||
|
||||
@unittest.skipUnless(locale_available('fr_FR.UTF-8') or
|
||||
locale_available('French'),
|
||||
'French locale needed')
|
||||
def test_french_strftime(self):
|
||||
# This test tries to reproduce an issue that occured with python3.3 under macos10 only
|
||||
locale.setlocale(locale.LC_ALL, str('fr_FR.UTF-8'))
|
||||
date = datetime.datetime(2014,8,14)
|
||||
# we compare the lower() dates since macos10 returns "Jeudi" for %A whereas linux reports "jeudi"
|
||||
self.assertEqual( u'jeudi, 14 août 2014', utils.strftime(date, date_format="%A, %d %B %Y").lower() )
|
||||
df = utils.DateFormatter()
|
||||
self.assertEqual( u'jeudi, 14 août 2014', df(date, date_format="%A, %d %B %Y").lower() )
|
||||
# Let us now set the global locale to C:
|
||||
locale.setlocale(locale.LC_ALL, str('C'))
|
||||
# DateFormatter should still work as expected since it is the whole point of DateFormatter
|
||||
# (This is where pre-2014/4/15 code fails on macos10)
|
||||
df_date = df(date, date_format="%A, %d %B %Y").lower()
|
||||
self.assertEqual( u'jeudi, 14 août 2014', df_date )
|
||||
|
||||
|
||||
@unittest.skipUnless(locale_available('fr_FR.UTF-8') or
|
||||
locale_available('French'),
|
||||
'French locale needed')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue