Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Operation validator should be called AFTER type validation. #18
When you implement a new data type, e.g., 'number', you'd expect it to be actually checked before the operations get validated. The test shows that currently you have to modify your method "_validate_min_number" and catch the exception raised by calling int(value), like the following:
def _validate_min_number(self, min_value, field, value): """Validates the 'min_number' operation on the 'number' data type.""" try: value = int(value) except ValueError: return super(BaseValidator, self)._validate_min(min_value, field, value)
Otherwise, you`ll get a ValueError, instead of a ValidationError (or whatever).