Commits

megamahi committed 4dc8dff

Fixed the JS test. There were 'invisible escapes' that didnt show

Comments (0)

Files changed (1)

 import tw2.core as twc
 import tw2.jqplugins.tagify
+from nose.tools import eq_
 
 def request_local_tst():
     global _request_local, _request_id
     twc.core.request_local()['middleware'] = twc.make_middleware()
 
 def test_js_call():
-    w = tw2.jqplugins.tagify.TagifyWidget(id='foobar')
+    w = tw2.jqplugins.tagify.TagifyWidget(id='foobar', options={'key':'value'})
     w.display()
 
     js_calls = filter(lambda x: "JSFuncCall" in str(x), w.resources)
 
     for js_call in js_calls:
         print js_call.src
-        assert(js_call.src == "$('#foobar').tagify({})")
+        eq_(js_call.src, """$('#foobar').tagify({\\"key\\": \\"value\\"})""")