diff options
author | Gael Pasgrimaud <gael@gawel.org> | 2012-11-26 11:48:55 -0800 |
---|---|---|
committer | Gael Pasgrimaud <gael@gawel.org> | 2012-11-26 11:48:55 -0800 |
commit | 4b8c15c08d48843cb64ff7ac0f0c0870c246890a (patch) | |
tree | dc441fd00d9fa2d97b5f60df2f6aeeaf5c62d8b2 | |
parent | aa8ae6860a7dc0214c2caf49b1622e43efcf637a (diff) | |
parent | 47e3afef3534a4bf710a45bdfb5d1afeafb56a91 (diff) | |
download | webtest-4b8c15c08d48843cb64ff7ac0f0c0870c246890a.tar.gz |
Merge pull request #18 from kilink/master
Add test for HTML entities inside textareas
-rw-r--r-- | tests/test_input.py | 10 |
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">'foo&bar'</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): |