diff options
author | Simen Heggestøyl <simen@e5r.no> | 2017-10-14 23:46:17 +0200 |
---|---|---|
committer | Boris Bobrov <breton@cynicmansion.ru> | 2017-10-16 18:21:28 +0300 |
commit | 3eadd6705e9ad5ee39042a130d7b3fdd74200d68 (patch) | |
tree | 25d9b832e4d868dbd4722f21e5db80e2fca2e3a4 /mediagoblin/tests | |
parent | ceab88e3bda83275ca2917708870bb87814a32e1 (diff) | |
download | mediagoblin-3eadd6705e9ad5ee39042a130d7b3fdd74200d68.tar.lz mediagoblin-3eadd6705e9ad5ee39042a130d7b3fdd74200d68.tar.xz mediagoblin-3eadd6705e9ad5ee39042a130d7b3fdd74200d68.zip |
Support Unicode characters in configuration values
Prior to this commit, using a Unicode character in a configuration
string would result in a `UnicodeDecodeError` being raised. Supporting
Unicode characters is especially useful in user-facing configuration
strings, such as `html_title`.
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r-- | mediagoblin/tests/fake_carrot_conf_good.ini | 2 | ||||
-rw-r--r-- | mediagoblin/tests/test_config.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/mediagoblin/tests/fake_carrot_conf_good.ini b/mediagoblin/tests/fake_carrot_conf_good.ini index 1377907b..8dc32525 100644 --- a/mediagoblin/tests/fake_carrot_conf_good.ini +++ b/mediagoblin/tests/fake_carrot_conf_good.ini @@ -7,7 +7,7 @@ num_carrots = 88 encouragement_phrase = "I'd love it if you eat your carrots!" # Something extra! -blah_blah = "blah!" +blah_blah = "blæh!" [celery] EAT_CELERY_WITH_CARROTS = False diff --git a/mediagoblin/tests/test_config.py b/mediagoblin/tests/test_config.py index b13adae6..c3527418 100644 --- a/mediagoblin/tests/test_config.py +++ b/mediagoblin/tests/test_config.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- +# # GNU MediaGoblin -- federated, autonomous media hosting # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. # @@ -47,7 +49,7 @@ def test_read_mediagoblin_config(): assert this_conf['carrotapp']['num_carrots'] == 88 assert this_conf['carrotapp']['encouragement_phrase'] == \ "I'd love it if you eat your carrots!" - assert this_conf['carrotapp']['blah_blah'] == "blah!" + assert this_conf['carrotapp']['blah_blah'] == u"blæh!" assert this_conf['celery']['EAT_CELERY_WITH_CARROTS'] == False # A bad file |