I'm having issues validating a required IntegerField when the JSON value passed is 0:
import wtforms_json
wtforms_json.init()
from wtforms import Form, IntegerField
from wtforms.validators import InputRequired
class MyForm(Form):
a = IntegerField(validators=[InputRequired()])
# Works with > 0
form = MyForm.from_json({'a': 5})
assert form.validate()
# Does not work with value 0
form = MyForm.from_json({'a': 0})
assert form.validate()
# Works with string '0'
form = MyForm.from_json({'a': '0'})
assert form.validate()
Using wtforms 2.0.2
I'm having issues validating a required IntegerField when the JSON value passed is 0:
Using wtforms 2.0.2