1. Ralph Bean
  2. tw2.jqplugins.tagify


megamahi  committed 4dc8dff

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

  • Participants
  • Parent commits 322c154
  • Branches default

Comments (0)

Files changed (1)

File tests/test_js.py

View file
 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'})
     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\\"})""")