summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms/tests.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-14 14:02:36 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-14 14:02:36 +0000
commitf15036ae6de5b2a4a6640aeabab16076217e9ea2 (patch)
treedec9242e5278295ed9f4cac628909d8f2266c3f2 /tests/regressiontests/forms/tests.py
parentc89dc9cfa0c8f59da93de05bb41c923f9397595e (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/tests.py')
-rw-r--r--tests/regressiontests/forms/tests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py
index 615cb2247b..82be58dd0c 100644
--- a/tests/regressiontests/forms/tests.py
+++ b/tests/regressiontests/forms/tests.py
@@ -2303,7 +2303,7 @@ returns a list of input.
Validation errors are HTML-escaped when output as HTML.
>>> class EscapingForm(Form):
... special_name = CharField()
-... def clean_special_name(self):
+... def do_clean_special_name(self):
... raise ValidationError("Something's wrong with '%s'" % self.clean_data['special_name'])
>>> f = EscapingForm({'special_name': "Nothing to escape"}, auto_id=False)
@@ -2326,7 +2326,7 @@ including the current field (e.g., the field XXX if you're in clean_XXX()).
... username = CharField(max_length=10)
... password1 = CharField(widget=PasswordInput)
... password2 = CharField(widget=PasswordInput)
-... def clean_password2(self):
+... def do_clean_password2(self):
... if self.clean_data.get('password1') and self.clean_data.get('password2') and self.clean_data['password1'] != self.clean_data['password2']:
... raise ValidationError(u'Please make sure your passwords match.')
... return self.clean_data['password2']