diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-02-15 05:05:43 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-02-15 05:05:43 +0000 |
| commit | b93614ada658087cbc90403ee8f36d7f8c947dfe (patch) | |
| tree | b1ee1178e4f6703be59db6f64e0846e5fc5b9ec2 /tests | |
| parent | a13a47e447c925ad39f0c3a4bd5c2cddfc74d3d3 (diff) | |
Fixed #3409 -- Added render_value argument to newforms PasswordInput. Thanks for the patch, scott@staplefish.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4523 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/forms/tests.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py index 644f922d28..080131ad01 100644 --- a/tests/regressiontests/forms/tests.py +++ b/tests/regressiontests/forms/tests.py @@ -72,6 +72,22 @@ u'<input type="password" class="special" name="email" />' >>> w.render('email', 'ŠĐĆŽćžšđ', attrs={'class': 'fun'}) u'<input type="password" class="fun" value="\u0160\u0110\u0106\u017d\u0107\u017e\u0161\u0111" name="email" />' +The render_value argument lets you specify whether the widget should render +its value. You may want to do this for security reasons. +>>> w = PasswordInput(render_value=True) +>>> w.render('email', 'secret') +u'<input type="password" name="email" value="secret" />' +>>> w = PasswordInput(render_value=False) +>>> w.render('email', '') +u'<input type="password" name="email" />' +>>> w.render('email', None) +u'<input type="password" name="email" />' +>>> w.render('email', 'secret') +u'<input type="password" name="email" />' +>>> w = PasswordInput(attrs={'class': 'fun'}, render_value=False) +>>> w.render('email', 'secret') +u'<input type="password" class="fun" name="email" />' + # HiddenInput Widget ############################################################ >>> w = HiddenInput() |
