Browse files

Fixed javascript test and tested wrap param

  • Loading branch information...
1 parent 4d09c83 commit 51bd46d4045ab9ee01d4af99237b9415c9e4185e @gregjurman gregjurman committed Mar 5, 2012
Showing with 8 additions and 4 deletions.
  1. +5 −1 tests/test_js.py
  2. +3 −3 tests/test_widget.py
View
6 tests/test_js.py
@@ -1,6 +1,8 @@
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:
@@ -31,4 +33,6 @@ def test_js_call():
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)""")
View
6 tests/test_widget.py
@@ -1,14 +1,14 @@
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):

0 comments on commit 51bd46d

Please sign in to comment.