def truc(title): global lib return t.div( t.h2(title), t.p('Bla bla bla', class_='btn btn-info'), lib.css('bootstrap'), )
def test_script(): r = t.section( t.h2('Subtitle'), t.script('alert("hello");'), ) assert r print(r.build()) assert r.build() == """<section>
def index(): return t.html( t.head( f.utf8(), f.viewport(), f.IEedge(), #lib.css('/static/bootstrap-3.2.0/css/bootstrap.min.css'), #lib.css('/static/bootstrap-3.2.0/css/bootstrap-theme.min.css'), lib.css('/static/style.css'), lib.js('d3'), lib.js('dimple'), #lib.js('/static/bootstrap-3.2.0/js/bootstrap.min.js'), lib.js('/stats/sent_vs_recv.js'), lib.js('/stats/sent_and_recv_over_time.js'), lib.js('/stats/obfuscated_profile.js'), lib.js('/stats/obfuscated_profile_outgoing.js'), lib.js('/stats/real_profile.js'), lib.js('/stats/real_profile_outgoing.js'), ), t.body( t.header( t.h1( 'Statistics', '/', t.a('Friends', href='/friends'), ), ), t.section( t.h2('Total traffic'), t.div(id='sent_vs_recv'), t.h2('Messages per minute'), t.div(id='sent_and_recv_over_time'), t.h2('Obfuscated outgoing profile'), t.div(id='obfuscated_profile_outgoing'), t.h2('Real outgoing profile'), t.div(id='real_profile_outgoing'), t.h2('Obfuscated profile'), t.div(id='obfuscated_profile'), t.h2('Real profile'), t.div(id='real_profile'), class_='container', ), ), ).build()