I'm trying to test a form created using wtform in flask using postman. In the form I have a FieldList of StringFields and I have specified minumum entries = 2. I have tried different solutions to test validations from postman, but always validation fails. I have tried testing by removing the fieldlist, the form validation works properly. I'm unable to send data as a list of stringfields from postman in x-www-form-urlencoded keyvalue format. Code Snippets:
class PostUserForm(Form):
email = StringField('email', [validators.DataRequired()])
name = StringField('name', [validators.DataRequired()])
words = FieldList(StringField('words',[validators.DataRequired()]), min_entries=2)
@apiV1.route('/user', methods=['POST'])
def post_user():
form = PostUserForm(request.form)
print request.form
if form.validate():
return jsonify("correct data"), 200
else:
return jsonify(form.errors), 400