Mercurial > genshi > genshi-test
comparison genshi/filters/tests/html.py @ 842:b09f746b4881 stable-0.5.x
Ported [1050] to 0.5.x branch.
author | cmlenz |
---|---|
date | Tue, 17 Mar 2009 18:06:31 +0000 |
parents | 85a61d0bd67b |
children |
comparison
equal
deleted
inserted
replaced
839:85a61d0bd67b | 842:b09f746b4881 |
---|---|
308 <select name="foo"> | 308 <select name="foo"> |
309 <option value="ö" selected="selected">foo</option> | 309 <option value="ö" selected="selected">foo</option> |
310 </select> | 310 </select> |
311 </form>""", unicode(html)) | 311 </form>""", unicode(html)) |
312 | 312 |
313 def test_fill_input_password_disabled(self): | |
314 html = HTML("""<form><p> | |
315 <input type="password" name="pass" /> | |
316 </p></form>""") | HTMLFormFiller(data={'pass': 'bar'}) | |
317 self.assertEquals("""<form><p> | |
318 <input type="password" name="pass"/> | |
319 </p></form>""", unicode(html)) | |
320 | |
321 def test_fill_input_password_enabled(self): | |
322 html = HTML("""<form><p> | |
323 <input type="password" name="pass" /> | |
324 </p></form>""") | HTMLFormFiller(data={'pass': '1234'}, passwords=True) | |
325 self.assertEquals("""<form><p> | |
326 <input type="password" name="pass" value="1234"/> | |
327 </p></form>""", unicode(html)) | |
328 | |
313 | 329 |
314 class HTMLSanitizerTestCase(unittest.TestCase): | 330 class HTMLSanitizerTestCase(unittest.TestCase): |
315 | 331 |
316 def test_sanitize_unchanged(self): | 332 def test_sanitize_unchanged(self): |
317 html = HTML('<a href="#">fo<br />o</a>') | 333 html = HTML('<a href="#">fo<br />o</a>') |