mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #3810 -- In newforms, copy attribute dictionaries before modifying them
in place. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4894 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
13
tests/regressiontests/forms/regressions.py
Normal file
13
tests/regressiontests/forms/regressions.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Tests to prevent against recurrences of earlier bugs.
|
||||
|
||||
regression_tests = r"""
|
||||
It should be possible to re-use attribute dictionaries (#3810)
|
||||
>>> from django.newforms import *
|
||||
>>> extra_attrs = {'class': 'special'}
|
||||
>>> class TestForm(Form):
|
||||
... f1 = CharField(max_length=10, widget=TextInput(attrs=extra_attrs))
|
||||
... f2 = CharField(widget=TextInput(attrs=extra_attrs))
|
||||
>>> TestForm(auto_id=False).as_p()
|
||||
u'<p>F1: <input type="text" class="special" name="f1" maxlength="10" /></p>\n<p>F2: <input type="text" class="special" name="f2" /></p>'
|
||||
"""
|
||||
Reference in New Issue
Block a user