From a75e2a147126e0613ed1b61e92ad8a2360facbf8 Mon Sep 17 00:00:00 2001 From: Jinfei Fan Date: Fri, 23 Jun 2017 10:52:12 -0400 Subject: [PATCH] add test case for none root fanstatic --- ckan/tests/test_none_root.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 ckan/tests/test_none_root.py diff --git a/ckan/tests/test_none_root.py b/ckan/tests/test_none_root.py new file mode 100644 index 00000000000..7ee1d220697 --- /dev/null +++ b/ckan/tests/test_none_root.py @@ -0,0 +1,19 @@ +# encoding: utf-8 + +from ckan.common import config +import ckan.plugins as p +import ckan.config.middleware as middleware +import webtest +import ckan.tests.helpers as helpers + + +class TestNoneRootCKAN(): + @helpers.change_config(u'ckan.root_path', u'/data/{{LANG}}') + def test_resource_url(self): + wsgiapp = middleware.make_app(config[u'global_conf'], **config) + app = webtest.TestApp(wsgiapp) + p.load(u'example_theme_v15_fanstatic') + content = app.get(u'/en/base.html') + assert u'example_theme.css' in content + assert u'href="/data/fanstatic/example_theme' in content + p.unload(u'example_theme_v15_fanstatic')