Permalink
Browse files

Mark as already escape JSFuncCall too and update test to check the re…

…sult for all the template engines
  • Loading branch information...
amol- committed Aug 28, 2012
1 parent 5e138ac commit 7c0c60ae24006e84f44f788224d08f7b68428759
Showing with 6 additions and 3 deletions.
  1. +3 −2 tests/test_resources.py
  2. +3 −1 tw2/core/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 == """<script type="text/javascript">foo("a", "b")</script>""", r
for t in self._get_all_possible_engines():
r = self.widget(**self.attrs).display(template='%s:%s' % (t, twr._JSFuncCall.template))
assert r == """<script type="text/javascript">foo("a", "b")</script>""", r
from pkg_resources import Requirement
class TestResourcesApp:
@@ -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):

0 comments on commit 7c0c60a

Please sign in to comment.