Skip to content

Commit

Permalink
Merge branch '2498-none'
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 26, 2015
2 parents dd5d6a4 + a2cf358 commit bc0830b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ckan/lib/app_globals.py
Expand Up @@ -221,7 +221,7 @@ def _init(self):

# process the config details to set globals
for key in app_globals_from_config_details.keys():
new_key, value = process_app_global(key, config.get(key))
new_key, value = process_app_global(key, config.get(key) or '')
setattr(self, new_key, value)


Expand Down
17 changes: 17 additions & 0 deletions ckan/tests/lib/test_app_globals.py
@@ -0,0 +1,17 @@
from ckan.lib.app_globals import app_globals as g


class TestGlobals(object):
def test_config_not_set(self):
# ckan.site_about has not been configured.
# Behaviour has always been to return an empty string.
assert g.site_about == ''

def test_config_set_to_blank(self):
# ckan.site_description is configured but with no value.
# Behaviour has always been to return an empty string.
assert g.site_description == ''

def test_set_from_ini(self):
# ckan.template_head_end is configured in test-core.ini
assert g.template_head_end == '<link rel="stylesheet" href="TEST_TEMPLATE_HEAD_END.css" type="text/css">'

0 comments on commit bc0830b

Please sign in to comment.