mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Fixed #10017 - PasswordResetForm.clean_email was not returning the value.
Thanks Zak Johnson, Leo git-svn-id: http://code.djangoproject.com/svn/django/trunk@9906 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -190,4 +190,33 @@ True
|
||||
False
|
||||
>>> form['username'].errors
|
||||
[u'This value must contain only letters, numbers and underscores.']
|
||||
|
||||
|
||||
### PasswordResetForm
|
||||
|
||||
>>> from django.contrib.auth.forms import PasswordResetForm
|
||||
>>> data = {'email':'not valid'}
|
||||
>>> form = PasswordResetForm(data)
|
||||
>>> form.is_valid()
|
||||
False
|
||||
>>> form['email'].errors
|
||||
[u'Enter a valid e-mail address.']
|
||||
|
||||
# Test nonexistant email address
|
||||
>>> data = {'email':'foo@bar.com'}
|
||||
>>> form = PasswordResetForm(data)
|
||||
>>> form.is_valid()
|
||||
False
|
||||
>>> form.errors
|
||||
{'email': [u"That e-mail address doesn't have an associated user account. Are you sure you've registered?"]}
|
||||
|
||||
# Test cleaned_data bug fix
|
||||
>>> user = User.objects.create_user("jsmith3", "jsmith3@example.com", "test123")
|
||||
>>> data = {'email':'jsmith3@example.com'}
|
||||
>>> form = PasswordResetForm(data)
|
||||
>>> form.is_valid()
|
||||
True
|
||||
>>> form.cleaned_data['email']
|
||||
u'jsmith3@example.com'
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user