summaryrefslogtreecommitdiff
path: root/pelican/tests/test_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'pelican/tests/test_utils.py')
-rw-r--r--pelican/tests/test_utils.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py
index 4a03cdc4..f0bc290d 100644
--- a/pelican/tests/test_utils.py
+++ b/pelican/tests/test_utils.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import locale
import logging
import os
@@ -480,9 +478,9 @@ class TestUtils(LoggedTestCase):
old_locale = locale.setlocale(locale.LC_ALL)
if platform == 'win32':
- locale.setlocale(locale.LC_ALL, str('Turkish'))
+ locale.setlocale(locale.LC_ALL, 'Turkish')
else:
- locale.setlocale(locale.LC_ALL, str('tr_TR.UTF-8'))
+ locale.setlocale(locale.LC_ALL, 'tr_TR.UTF-8')
d = utils.SafeDatetime(2012, 8, 29)
@@ -514,9 +512,9 @@ class TestUtils(LoggedTestCase):
old_locale = locale.setlocale(locale.LC_ALL)
if platform == 'win32':
- locale.setlocale(locale.LC_ALL, str('French'))
+ locale.setlocale(locale.LC_ALL, 'French')
else:
- locale.setlocale(locale.LC_ALL, str('fr_FR.UTF-8'))
+ locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
d = utils.SafeDatetime(2012, 8, 29)
@@ -557,7 +555,7 @@ class TestCopy(unittest.TestCase):
def setUp(self):
self.root_dir = mkdtemp(prefix='pelicantests.')
self.old_locale = locale.setlocale(locale.LC_ALL)
- locale.setlocale(locale.LC_ALL, str('C'))
+ locale.setlocale(locale.LC_ALL, 'C')
def tearDown(self):
shutil.rmtree(self.root_dir)
@@ -666,26 +664,26 @@ class TestDateFormatter(unittest.TestCase):
# This test tries to reproduce an issue that
# occurred with python3.3 under macos10 only
if platform == 'win32':
- locale.setlocale(locale.LC_ALL, str('French'))
+ locale.setlocale(locale.LC_ALL, 'French')
else:
- locale.setlocale(locale.LC_ALL, str('fr_FR.UTF-8'))
+ locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
date = utils.SafeDatetime(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',
+ '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',
+ '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'))
+ locale.setlocale(locale.LC_ALL, '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)
+ self.assertEqual('jeudi, 14 août 2014', df_date)
@unittest.skipUnless(locale_available('fr_FR.UTF-8') or
locale_available('French'),