Flask unit test throwing Error: has no attribute 'csrf_token' in Jinja2 template
In your jinja template first check to see if the value is set, and then if it is include it.
{% if 'csrf_token' in form %} {{form.csrf_token}}{% endif %}
In your jinja template first check to see if the value is set, and then if it is include it.
{% if 'csrf_token' in form %} {{form.csrf_token}}{% endif %}