def assert_valid(self, instance, value=None):
        """Returns True if the Property is valid on a HasProperties instance

        Raises a ValueError if the value is invalid.
        """
        if value is None:
            value = instance._get(self.name)
        if (
                value is not None and
                not self.equal(value, self.validate(instance, value))
        ):
            message = 'Invalid value for property: {}: {}'.format(
                self.name, value
            )
            raise ValidationError(message, 'invalid', self.name, instance)
        return True
def assert_valid ( self , instance , value = None ) : if value is None : value = instance . _get ( self . name ) if ( value is not None and not self . equal ( value , self . validate ( instance , value ) ) ) : message = 'Invalid value for property: {}: {}' . format ( self . name , value ) raise ValidationError ( message , 'invalid' , self . name , instance ) return True
Returns True if the Property is valid on a HasProperties instance

        Raises a ValueError if the value is invalid.