src/auth/routes.py : blueprint auth et fixtures de test (#73)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,3 +10,26 @@ def users_db_path(monkeypatch, tmp_path):
|
||||
reset_conn_for_tests()
|
||||
yield db_path
|
||||
reset_conn_for_tests()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app(users_db_path, monkeypatch):
|
||||
from flask import Flask
|
||||
|
||||
from src.auth.setup import init_auth
|
||||
|
||||
app = Flask(__name__)
|
||||
init_auth(app)
|
||||
yield app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client(app):
|
||||
return app.test_client()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mail_outbox(app):
|
||||
mail = app.extensions["mail"]
|
||||
with mail.record_messages() as outbox:
|
||||
yield outbox
|
||||
|
||||
Reference in New Issue
Block a user