diff --git a/tests/test_resources.py b/tests/test_resources.py index b913beb..ee80cc5 100644 --- a/tests/test_resources.py +++ b/tests/test_resources.py @@ -262,8 +262,9 @@ class TestJsFuncall(tb.WidgetTest): expected = None def test_display(self): - r = self.widget(**self.attrs).display(**self.params) - assert r == """""", r + for t in self._get_all_possible_engines(): + r = self.widget(**self.attrs).display(template='%s:%s' % (t, twr._JSFuncCall.template)) + assert r == """""", r from pkg_resources import Requirement class TestResourcesApp: diff --git a/tw2/core/resources.py b/tw2/core/resources.py index b3c7f9e..becf832 100644 --- a/tw2/core/resources.py +++ b/tw2/core/resources.py @@ -16,6 +16,8 @@ import middleware as md from js import encoder, js_symbol +from markupsafe import Markup + log = logging.getLogger(__name__) @@ -275,7 +277,7 @@ def prepare(self): elif self.args: args = ', '.join(encoder.encode(a) for a in self.args) - self.src = '%s(%s)' % (self.function, args) + self.src = Markup('%s(%s)' % (self.function, args)) super(_JSFuncCall, self).prepare() def __hash__(self):