diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-14 14:02:36 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-14 14:02:36 +0000 |
| commit | f15036ae6de5b2a4a6640aeabab16076217e9ea2 (patch) | |
| tree | dec9242e5278295ed9f4cac628909d8f2266c3f2 /tests/regressiontests/forms/regressions.py | |
| parent | c89dc9cfa0c8f59da93de05bb41c923f9397595e (diff) | |
Renamed form-specific cleaning methods to be do_clean_*, rather than clean_*.
This avoids a name clash that would occur when you had a form field called
"data" (because clean_data is already a dictionary on the Form class).
Backwards incompatible change.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5231 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms/regressions.py')
| -rw-r--r-- | tests/regressiontests/forms/regressions.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/regressions.py b/tests/regressiontests/forms/regressions.py index 5daabc03af..789ac81715 100644 --- a/tests/regressiontests/forms/regressions.py +++ b/tests/regressiontests/forms/regressions.py @@ -34,4 +34,18 @@ Unicode decoding problems... >>> f = SomeForm() >>> f.as_p() u'<p><label for="id_somechoice_0">Somechoice:</label> <ul>\n<li><label><input type="radio" id="id_somechoice_0" value="0" name="somechoice" /> En tied\xe4</label></li>\n<li><label><input type="radio" id="id_somechoice_1" value="1" name="somechoice" /> Mies</label></li>\n<li><label><input type="radio" id="id_somechoice_2" value="2" name="somechoice" /> Nainen</label></li>\n</ul></p>' + +####################### +# Miscellaneous Tests # +####################### + +There once was a problem with Form fields called "data". Let's make sure that +doesn't come back. +>>> class DataForm(Form): +... data = CharField(max_length=10) +>>> f = DataForm({'data': 'xyzzy'}) +>>> f.is_valid() +True +>>> f.clean_data +{'data': u'xyzzy'} """ |
