Mock out app NotificationSender during testing
This commit is contained in:
@@ -12,7 +12,7 @@ from atst.database import db as _db
|
||||
from atst.queue import queue as atst_queue
|
||||
import tests.factories as factories
|
||||
from tests.mocks import PDF_FILENAME, PDF_FILENAME2
|
||||
from tests.utils import FakeLogger
|
||||
from tests.utils import FakeLogger, FakeNotificationSender
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from cryptography.hazmat.primitives.asymmetric import rsa
|
||||
@@ -307,3 +307,13 @@ def mock_logger(app):
|
||||
yield app.logger
|
||||
|
||||
app.logger = real_logger
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_notification_sender(app):
|
||||
real_notification_sender = app.notification_sender
|
||||
app.notification_sender = FakeNotificationSender()
|
||||
|
||||
yield app.notification_sender
|
||||
|
||||
app.notification_sender = real_notification_sender
|
||||
|
Reference in New Issue
Block a user