MCPcopy Create free account
hub / github.com/Pylons/webtest / test_form_lint

Method test_form_lint

tests/test_forms.py:298–326  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

296class TestFormLint(unittest.TestCase):
297
298 def test_form_lint(self):
299 def _build_response(html):
300 return webtest.TestResponse('<body>{}</body>'.format(html))
301
302 html = ''&#x27;<form>
303 <input type="text" name="field"/>
304 </form>''&#x27;
305 form = webtest.Form(_build_response(html), html)
306 self.assertRaises(AttributeError, form.lint)
307
308 html = ''&#x27;<form>
309 <input type="text" id="myfield" name="field"/>
310 </form>''&#x27;
311 form = webtest.Form(_build_response(html), html)
312 self.assertRaises(AttributeError, form.lint)
313
314 html = ''&#x27;<form>
315 <label for="myfield">my field</label>
316 <input type="text" id="myfield" name="field"/>
317 </form>''&#x27;
318 form = webtest.Form(_build_response(html), html)
319 form.lint()
320
321 html = ''&#x27;<form>
322 <label class="field" for="myfield" role="r">my field</label>
323 <input type="text" id="myfield" name="field"/>
324 </form>''&#x27;
325 form = webtest.Form(_build_response(html), html)
326 form.lint()
327
328
329def select_app(environ, start_response):

Callers

nothing calls this directly

Calls 1

lintMethod · 0.95

Tested by

no test coverage detected