'Tests that validation raise on none and blank values if value required.'

def test_required_validation(self):

    Ascii(required=True).validate('k')
    with self.assertRaises(ValidationError):
        Ascii(required=True).validate('')
    with self.assertRaises(ValidationError):
        Ascii(required=True).validate(None)
    Ascii(required=True, min_length=0).validate('k')
    Ascii(required=True, min_length=1).validate('k')
    with self.assertRaises(ValidationError):
        Ascii(required=True, min_length=2).validate('k')
    Ascii(required=True, max_length=1).validate('k')
    with self.assertRaises(ValidationError):
        Ascii(required=True, max_length=2).validate('kevin')
    with self.assertRaises(ValueError):
        Ascii(required=True, max_length=0)
