cic-internal-integration/apps/cic-notify/tests/cic_notify/tasks/sms/test_log_tasks.py

22 lines
478 B
Python
Raw Normal View History

2022-01-04 11:34:47 +01:00
# standard imports
import logging
2022-01-04 11:34:47 +01:00
# external imports
import celery
# local imports
# test imports
from tests.helpers.phone import phone_number
def test_log(caplog, celery_session_worker):
message = 'Hello world.'
recipient = phone_number()
caplog.set_level(logging.INFO)
2022-01-04 11:34:47 +01:00
s_log = celery.signature(
'cic_notify.tasks.sms.log.log', [message, recipient]
)
s_log.apply_async().get()
assert f'message to {recipient}: {message}' in caplog.text