Permalink
Browse files

Added a half-done test of the chained js feature.

  • Loading branch information...
ralphbean committed Mar 14, 2012
1 parent 0b93917 commit fe6924f896e64c6244551b47728a91c512dc16ee
Showing with 23 additions and 0 deletions.
  1. +23 −0 tests/test_resources.py
@@ -340,6 +340,29 @@ def testJSSource(self):
res = str(s.req())
self.assert_(token in res, res)
def testJSFuncCallChained(self):
options = {'foo': 20}
jQuery = twc.js_function('jQuery')
when_ready = lambda func: js_callback(
'$(document).ready(function(){' + str(func) + '});'
)
class Dummy(twc.Widget):
id = 'dummy'
template = "foo"
inline_template_engine = "mako"
def prepare(self):
super(Dummy, self).prepare()
self.add_call(when_ready(
jQuery('.%s' % self.id).buildMenu(options)
))
output = Dummy.display()
eq_(output, "put real target data here")
def testJSFuncCallDictArgs(self):
args = dict(foo="foo", bar="bar")
function = "jquery"

0 comments on commit fe6924f

Please sign in to comment.