Implement CSRF
This commit is contained in:
@ -2,13 +2,16 @@
|
||||
|
||||
"""PyTest unit tests."""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
|
||||
from app.app import app
|
||||
from app.app import app, csrf
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
"""Set up Flask client for use in tests."""
|
||||
app.secret_key = os.urandom(12).hex()
|
||||
csrf.init_app(app)
|
||||
client = app.test_client()
|
||||
yield client
|
||||
|
Reference in New Issue
Block a user