Commits

megamahi  committed e2378de

Fixed javascript test and tested wrap param

  • Participants
  • Parent commits eab6fcd

Comments (0)

Files changed (2)

File tests/test_js.py

 import tw2.core as twc
 import tw2.dyntext
 
+from nose.tools import eq_
+
 def request_local_tst():
     global _request_local, _request_id
 # if _request_id is None:
     assert(len(js_calls) > 0)
 
     for js_call in js_calls:
-        assert(js_call.src == """setupPollingDynText("foobar", "/herp/derp", 5000)""")
+        js = js_call.req()
+        js.prepare()
+        eq_(js.src, """setupPollingDynText("foobar", "/herp/derp", 5000)""")

File tests/test_widget.py

 from tw2.core.testbase import  WidgetTest
 import tw2.dyntext
 
-class TestDemoWidget(WidgetTest):
+class TestPollingDemoWidget(WidgetTest):
     # place your widget at the TestWidget attribute
     widget = tw2.dyntext.PollingDynamicTextWidget
 
     # Initilization args. go here
     attrs = {'id' : 'affected_count'}
-    params = {'data_url' : '/stats/affected_count'}
-    expected = """<span id="affected_count"></span>"""
+    params = {'wrap': 'div', 'data_url' : '/stats/affected_count'}
+    expected = """<div id="affected_count"></div>"""
 
 
 class TestDemoWidget(WidgetTest):