summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGael Pasgrimaud <gael@gawel.org>2012-11-26 11:48:55 -0800
committerGael Pasgrimaud <gael@gawel.org>2012-11-26 11:48:55 -0800
commit4b8c15c08d48843cb64ff7ac0f0c0870c246890a (patch)
treedc441fd00d9fa2d97b5f60df2f6aeeaf5c62d8b2
parentaa8ae6860a7dc0214c2caf49b1622e43efcf637a (diff)
parent47e3afef3534a4bf710a45bdfb5d1afeafb56a91 (diff)
downloadwebtest-4b8c15c08d48843cb64ff7ac0f0c0870c246890a.tar.gz
Merge pull request #18 from kilink/master
Add test for HTML entities inside textareas
-rw-r--r--tests/test_input.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_input.py b/tests/test_input.py
index efbb101..7cb459a 100644
--- a/tests/test_input.py
+++ b/tests/test_input.py
@@ -27,6 +27,9 @@ def input_app(environ, start_response):
<input name="foo" type="checkbox" value="bar" checked>
<input name="button" type="submit" value="text">
</form>
+ <form method="POST" id="textarea_input_form">
+ <textarea name="textarea">&#39;&#x66;&#x6f;&#x6f;&amp;&#x62;&#x61;&#x72;&#39;</textarea>
+ </form>
</body>
</html>
""")
@@ -158,6 +161,13 @@ class TestInput(unittest.TestCase):
self.assertTrue(form['foo'].value is None)
self.assertEqual(form.submit_fields(), [])
+ def test_textarea_entities(self):
+ app = webtest.TestApp(input_app)
+ res = app.get('/')
+ form = res.forms.get("textarea_input_form")
+ self.assertEqual(form.get("textarea").value, "'foo&bar'")
+ self.assertEqual(form.submit_fields(), [('textarea', "'foo&bar'")])
+
class TestFormLint(unittest.TestCase):