Adds log levels for caplog since pytest isn't run in debug.
This commit is contained in:
parent
c5ee59f836
commit
e4c41c2d3e
@ -1,4 +1,5 @@
|
|||||||
# standard imports
|
# standard imports
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# external imports
|
# external imports
|
||||||
@ -15,6 +16,7 @@ from tests.helpers.phone import phone_number
|
|||||||
|
|
||||||
|
|
||||||
def test_africas_talking_notifier(africastalking_response, caplog):
|
def test_africas_talking_notifier(africastalking_response, caplog):
|
||||||
|
caplog.set_level(logging.DEBUG)
|
||||||
with pytest.raises(NotInitializedError) as error:
|
with pytest.raises(NotInitializedError) as error:
|
||||||
AfricasTalkingNotifier()
|
AfricasTalkingNotifier()
|
||||||
assert str(error.value) == ''
|
assert str(error.value) == ''
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# standard imports
|
# standard imports
|
||||||
|
import logging
|
||||||
|
|
||||||
# external imports
|
# external imports
|
||||||
import celery
|
import celery
|
||||||
@ -12,6 +13,7 @@ from tests.helpers.phone import phone_number
|
|||||||
def test_log(caplog, celery_session_worker):
|
def test_log(caplog, celery_session_worker):
|
||||||
message = 'Hello world.'
|
message = 'Hello world.'
|
||||||
recipient = phone_number()
|
recipient = phone_number()
|
||||||
|
caplog.set_level(logging.INFO)
|
||||||
s_log = celery.signature(
|
s_log = celery.signature(
|
||||||
'cic_notify.tasks.sms.log.log', [message, recipient]
|
'cic_notify.tasks.sms.log.log', [message, recipient]
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user