Testing a POST that uses Flask-WTF validate_on_submit

后端 未结 2 492
误落风尘
误落风尘 2021-01-18 00:26

I am stumped on testing a POST to add a category to the database where I\'ve used Flask_WTF for validation and CSRF protection. For the CRUD operations pm my website. I\'ve

2条回答
  •  囚心锁ツ
    2021-01-18 01:12

    You should have different configurations for your app, depending if you are local / in production / executing unit tests. One configuration you can set is

    WTF_CSRF_ENABLED = False
    

    See flask-wtforms documentation.

提交回复
热议问题