diff --git a/pelican/tests/default_conf.py b/pelican/tests/default_conf.py index 80a990b5..62594894 100644 --- a/pelican/tests/default_conf.py +++ b/pelican/tests/default_conf.py @@ -9,7 +9,6 @@ GITHUB_URL = 'http://github.com/ametaireau/' DISQUS_SITENAME = "blog-notmyidea" PDF_GENERATOR = False REVERSE_CATEGORY_ORDER = True -LOCALE = "" DEFAULT_PAGINATION = 2 FEED_RSS = 'feeds/all.rss.xml' diff --git a/pelican/tests/test_settings.py b/pelican/tests/test_settings.py index b1e813e1..7907a551 100644 --- a/pelican/tests/test_settings.py +++ b/pelican/tests/test_settings.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals, print_function import copy import os +import locale from os.path import dirname, abspath, join from pelican.settings import (read_settings, configure_settings, @@ -92,3 +93,14 @@ class TestSettingsConfiguration(unittest.TestCase): settings['FEED_DOMAIN'] = 'http://feeds.example.com' configure_settings(settings) self.assertEqual(settings['FEED_DOMAIN'], 'http://feeds.example.com') + + def test_default_encoding(self): + # test that the default locale is set if + # locale is not specified in the settings + + #reset locale to python default + locale.setlocale(locale.LC_ALL, str('C')) + self.assertEqual(self.settings['LOCALE'], DEFAULT_CONFIG['LOCALE']) + + configure_settings(self.settings) + self.assertEqual(locale.getlocale(), locale.getdefaultlocale())