def test_error_email_required_None(): schema = (email.Email().trim().required('Email is required')) result = schema.validate(None) assert result['success'] is False assert result['error'] is not None
def test_validate_string(): schema = email.Email() result = schema.validate({'name': 'kanpai'}) assert result['success'] is False assert result['error'] is not None
def test_validate_email_required_success(): schema = (email.Email().trim().required('Email is required')) result = schema.validate(' [email protected]') assert result['success'] is True assert result['error'] is None
def test_validate_stringandpattern_failure(): schema = email.Email() result = schema.validate('a@bcom') assert result['success'] is False assert result['error'] is not None
def test_validate_stringandpattern_success(): schema = email.Email() result = schema.validate('*****@*****.**') assert result['success'] is True assert result['error'] is None
def test_validate_string_on_None_data(): schema = email.Email() result = schema.validate(None) assert result['success'] is True assert result['error'] is None