From 4e0a736f6f96aa8a1d07b696b4a2cbf013db6e05 Mon Sep 17 00:00:00 2001 From: Diarmuid Bourke Date: Tue, 26 Feb 2013 16:14:33 +0000 Subject: Tests for input fields of type password. This checks that input fields with type password work and act like text input fields. --- tests/test_forms.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/test_forms.py b/tests/test_forms.py index 544690d..85c1db7 100644 --- a/tests/test_forms.py +++ b/tests/test_forms.py @@ -173,6 +173,10 @@ def input_app(environ, start_response): +
+ + +
@@ -207,6 +211,10 @@ def input_app_without_default(environ, start_response): +
+ + +
""") @@ -238,6 +246,10 @@ u(""" +
+ + +
""").encode('utf8') @@ -269,6 +281,10 @@ class TestInput(unittest.TestCase): self.assertEqual(form['foo'].value, 'bar') self.assertEqual(form.submit_fields(), [('foo', 'bar')]) + form = res.forms['password_input_form'] + self.assertEqual(form['foo'].value, 'bar') + self.assertEqual(form.submit_fields(), [('foo', 'bar')]) + def test_input_unicode(self): app = webtest.TestApp(input_unicode_app) res = app.get('/') @@ -288,6 +304,10 @@ class TestInput(unittest.TestCase): self.assertEqual(form['foo'].value, u('Хармс')) self.assertEqual(form.submit_fields(), [('foo', u('Хармс'))]) + form = res.forms['password_input_form'] + self.assertEqual(form['foo'].value, u('Хармс')) + self.assertEqual(form.submit_fields(), [('foo', u('Хармс'))]) + def test_input_no_default(self): app = webtest.TestApp(input_app_without_default) res = app.get('/') @@ -307,6 +327,10 @@ class TestInput(unittest.TestCase): self.assertTrue(form['foo'].value is None) self.assertEqual(form.submit_fields(), []) + form = res.forms['password_input_form'] + self.assertEqual(form['foo'].value, '') + self.assertEqual(form.submit_fields(), [('foo', '')]) + def test_textarea_entities(self): app = webtest.TestApp(input_app) res = app.get('/') -- cgit v1.2.1