def test_wrong_email(self): f = ResetPasswordForm() f.cleaned_data= {'email': "*****@*****.**"} try: f.clean_email() except forms.ValidationError, err: eq_(err.messages, ( ["No user exists with that email. Please ask [email protected] " "to add you to the volunteer tracker."]))
def password_change(request, template_name="password_change_form.html", post_change_redirect=None): if post_change_redirect is None: post_change_redirect = reverse("chirp.volunteers.views.password_change_done") if request.method == "POST": form = ResetPasswordForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect(post_change_redirect) else: form = ResetPasswordForm() return render_to_response(template_name, {"form": form}, context_instance=RequestContext(request))
def password_change(request, template_name='password_change_form.html', post_change_redirect=None): if post_change_redirect is None: post_change_redirect = reverse( 'chirp.volunteers.views.password_change_done') if request.method == "POST": form = ResetPasswordForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect(post_change_redirect) else: form = ResetPasswordForm() return render_to_response(template_name, { 'form': form, }, context_instance=RequestContext(request))