diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-26 21:32:17 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-26 21:32:17 +0000 |
| commit | 1fc8f84f58d53033cd74afb9b26ca60dd18a055c (patch) | |
| tree | 9f46c865dd4e737cb3698fd55ac9c13865f419dd /tests/regressiontests/forms/widgets.py | |
| parent | 5f396193fb12d556cb70c702cddd28e295a5ed20 (diff) | |
Fixed #8566 -- Allow safe-strings in the "attrs" parameter to form widgets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms/widgets.py')
| -rw-r--r-- | tests/regressiontests/forms/widgets.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/widgets.py b/tests/regressiontests/forms/widgets.py index df0f5d6fd7..cc11d407e8 100644 --- a/tests/regressiontests/forms/widgets.py +++ b/tests/regressiontests/forms/widgets.py @@ -50,6 +50,11 @@ u'<input type="text" class="fun" value="foo@example.com" name="email" />' >>> w.render('email', '', attrs={'class': 'special'}) u'<input type="text" class="special" name="email" />' +'attrs' can be safe-strings if needed +>>> w = TextInput(attrs={'onBlur': mark_safe("function('foo')")}) +>>> print w.render('email', '') +<input onBlur="function('foo')" type="text" name="email" /> + # PasswordInput Widget ############################################################ >>> w = PasswordInput() |
