@@ -134,6 +134,9 @@ def test_button_submit_by_value_and_index(self):
134134 form .submit , "action" , value = "activate" ,
135135 index = 0 )
136136
137+ def test_outer_inputs (self ):
138+ form = self .callFUT (formid = 'outer_inputs_form' )
139+ self .assertEqual (('foo' , 'bar' , 'button' ), tuple (form .fields ))
137140
138141class TestResponseFormAttribute (unittest .TestCase ):
139142
@@ -285,26 +288,33 @@ def test_textarea_emptyfirstline(self):
285288class TestFormLint (unittest .TestCase ):
286289
287290 def test_form_lint (self ):
288- form = webtest .Form (None , '''<form>
291+ def _build_response (html ):
292+ return webtest .TestResponse ('<body>{}</body>' .format (html ))
293+
294+ html = '''<form>
289295 <input type="text" name="field"/>
290- </form>''' )
296+ </form>'''
297+ form = webtest .Form (_build_response (html ), html )
291298 self .assertRaises (AttributeError , form .lint )
292299
293- form = webtest . Form ( None , '''<form>
300+ html = '''<form>
294301 <input type="text" id="myfield" name="field"/>
295- </form>''' )
302+ </form>'''
303+ form = webtest .Form (_build_response (html ), html )
296304 self .assertRaises (AttributeError , form .lint )
297305
298- form = webtest . Form ( None , '''<form>
306+ html = '''<form>
299307 <label for="myfield">my field</label>
300308 <input type="text" id="myfield" name="field"/>
301- </form>''' )
309+ </form>'''
310+ form = webtest .Form (_build_response (html ), html )
302311 form .lint ()
303312
304- form = webtest . Form ( None , '''<form>
313+ html = '''<form>
305314 <label class="field" for="myfield" role="r">my field</label>
306315 <input type="text" id="myfield" name="field"/>
307- </form>''' )
316+ </form>'''
317+ form = webtest .Form (_build_response (html ), html )
308318 form .lint ()
309319
310320
0 commit comments