def test_forgot_password_wrong_mail(self):
        bad_email = '*****@*****.**'
        response = self.app.post(pwd_reset_url, {
            'email': bad_email,
        })

        msg = validators.ValidSystemEmail()._messages['non_existing_email']
        msg = h.html_escape(msg % {'email': bad_email})
        response.mustcontain()
Esempio n. 2
0
    def test_ValidSystemEmail(self):
        validator = v.ValidSystemEmail()
        email = TEST_USER_REGULAR2_EMAIL

        self.assertEqual(email, validator.to_python(email))
        self.assertRaises(formencode.Invalid, validator.to_python, 'err')
Esempio n. 3
0
 class _PasswordResetForm(formencode.Schema):
     allow_extra_fields = True
     filter_extra_fields = True
     email = All(v.ValidSystemEmail(), v.Email(not_empty=True))
def test_ValidSystemEmail():
    validator = v.ValidSystemEmail()
    email = TEST_USER_REGULAR2_EMAIL

    assert email == validator.to_python(email)
    pytest.raises(formencode.Invalid, validator.to_python, 'err')