def submit_form(self, payload): with app.test_request_context(): form = RideForm(data=payload) return form.validate()
def submit_form(self, form, payload): with app.test_request_context(): myform = form(data=payload) return myform.validate()