So I have unit tests that tests validation in a form that has a field
with requires=IS_NULL_OR(IS_IN_DB( set ))
When this validator is run in normal environment (without unit-
testing) this works flawlessly but in my unit test it kept failing...
then I discovered that the code in IS_IN_DB's __call__(self, value):

elif self.theset:
    if value in self.theset:
        if self._and:
            return self._and(value)
        else:
            return (value, None)

does not work if you send a value of type int in request.vars, as it
expects an int as a string. The validator will put the field in
form.errors.
The field is set to type 'integer' so I just assumed that it would
work with an int.

Anyway it works now with the int as a string and I just wanted to put
this out there if anyone else runs into this

Reply via email to