Permalink
Browse files

Trying to duplicate an issue with Deferred.

  • Loading branch information...
ralphbean committed Jul 10, 2012
1 parent f78492b commit cefbbfd739c1b803039a9dded72098db8fc540b3
Showing with 25 additions and 0 deletions.
  1. +25 −0 tests/test_widgets.py
@@ -70,6 +70,31 @@ def test_deferred(self):
ins.prepare()
assert(ins.template == 'test')
def test_deferred_value_no_subclass(self):
test = twc.Widget(id='test',
template="<p>${w.value}</p>",
inline_engine_name="mako",
value=twc.Deferred(lambda: 'test'))
assert(test.value != 'test')
ins = test.req()
ins.prepare()
assert(ins.value == 'test')
assert(test.display() == "<p>test</p>")
def test_deferred_value_subclass(self):
class TestWidget(twc.Widget):
id='test'
inline_engine_name = 'mako'
template = "<p>${w.value}</p>"
value=twc.Deferred(lambda: 'test')
test = TestWidget
assert(test.value != 'test')
ins = test.req()
ins.prepare()
assert(ins.value == 'test')
assert(test.display() == "<p>test</p>")
def test_child_attr(self):
class LayoutContainer(twc.CompoundWidget):
label = twc.ChildParam(default='b')

0 comments on commit cefbbfd

Please sign in to comment.