'Tests that password reset fail when providing bad passwords and error message is displayed
to the user.'

@ddt.data(('foo', 'foobar'), ('', ''))
@ddt.unpack
def test_password_reset_form_invalid(self, password1, password2):

    (user_email, _) = self._setup_user()
    err_msg = 'Error    in    resetting    your    password.    Please    try    again.'
    user = User.objects.get(email=user_email)
    token = default_token_generator.make_token(user)
    uidb36 = int_to_base36(user.id)
    resp = self.client.post('/password_reset_confirm/{0}-{1}/'.format(uidb36, token), {'new_password1': password1, 'new_password2': password2}, follow=True)
    self.assertPasswordResetError(resp, err_msg, valid_link=True)
