Skip to content

Commit

Permalink
Fixed javascript test and tested wrap param
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Jurman committed Mar 6, 2012
1 parent 4d09c83 commit 51bd46d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion tests/test_js.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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)""")
6 changes: 3 additions & 3 deletions tests/test_widget.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down

0 comments on commit 51bd46d

Please sign in to comment.