193 | | """ |
| 193 | |
| 194 | |
| 195 | ### PasswordResetForm |
| 196 | |
| 197 | >>> from django.contrib.auth.forms import PasswordResetForm |
| 198 | >>> data = {'email':'not valid'} |
| 199 | >>> form = PasswordResetForm(data) |
| 200 | >>> form.is_valid() |
| 201 | False |
| 202 | >>> form['email'].errors |
| 203 | [u'Enter a valid e-mail address.'] |
| 204 | |
| 205 | # Test nonexistant email address |
| 206 | >>> data = {'email':'foo@bar.com'} |
| 207 | >>> form = PasswordResetForm(data) |
| 208 | >>> form.is_valid() |
| 209 | False |
| 210 | >>> form.errors |
| 211 | {'email': [u"That e-mail address doesn't have an associated user account. Are you sure you' |
| 212 | ve registered?"]} |
| 213 | |
| 214 | # Test cleaned_data bug fix |
| 215 | >>> user = User.objects.create_user("jsmith3", "jsmith3@example.com", "test123") |
| 216 | >>> data = {'email':'jsmith3@example.com'} |
| 217 | >>> form = PasswordResetForm(data) |
| 218 | >>> form.is_valid() |
| 219 | True |
| 220 | >>> form.cleaned_data['email'] |
| 221 | u'jsmith@example.com' |
| 222 | |
| 223 | """ |
| 224 | No newline at end of file |