Skip to content

Commit

Permalink
Add additional test for locale without root_path
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Oderbolz committed Aug 27, 2015
1 parent 6d0409e commit 89336e8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ckan/tests/lib/test_helpers.py
Expand Up @@ -93,10 +93,20 @@ def test_url_for_qualified_with_root_path(self):
qualified=True)
eq_(generated_url, url)

@helpers.change_config('ckan.site_url', 'http://example.com')
def test_url_for_qualified_with_locale(self):
url = 'http://example.com/de/foo/dataset/my_dataset'
generated_url = h.url_for(controller='package',
action='read',
id='my_dataset',
qualified=True,
locale='de')
eq_(generated_url, url)

@helpers.change_config('ckan.site_url', 'http://example.com')
@helpers.change_config('ckan.root_path', '/my/custom/path/{{LANG}}/foo')
def test_url_for_qualified_with_root_path_and_locale(self):
url = 'http://example.com/my/custom/path/en/foo/dataset/my_dataset'
url = 'http://example.com/my/custom/path/de/foo/dataset/my_dataset'
generated_url = h.url_for(controller='package',
action='read',
id='my_dataset',
Expand Down

0 comments on commit 89336e8

Please sign in to comment.