

def test_email(self):
    schema = schemas.EmailField.definition()
    definition = schema.deserialize({
        'name': 'address',
        'type': 'email',
    })
    validator = schemas.EmailField.validation(**definition)
    self.assertEquals('u@you.org', validator.deserialize('u@you.org'))
    self.assertEquals('u+i@you.org', validator.deserialize('u+i@you.org'))
    self.assertRaises(colander.Invalid, validator.deserialize, 'u i@you.org')

dataset/ETHPy150Open spiral-project/daybed/daybed/tests/test_schemas_base.py BaseFieldsTests.test_email/original