Skip to content

Commit 6a634bf

Browse files
authored
Merge pull request aaronn#59 from timstallmann/timstallmann-better-testing-for-mobile
Minor for testing with mobile workflow
2 parents 9f08f55 + 21a7147 commit 6a634bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drfpasswordless/utils.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ def send_sms_with_callback_token(user, mobile_token, **kwargs):
154154
155155
Passes silently without sending in test environment.
156156
"""
157+
if api_settings.PASSWORDLESS_TEST_SUPPRESSION is True:
158+
# we assume success to prevent spamming SMS during testing.
159+
return True
160+
157161
base_string = kwargs.get('mobile_message', api_settings.PASSWORDLESS_MOBILE_MESSAGE)
158162

159163
try:
160-
161164
if api_settings.PASSWORDLESS_MOBILE_NOREPLY_NUMBER:
162165
# We need a sending number to send properly
163-
if api_settings.PASSWORDLESS_TEST_SUPPRESSION is True:
164-
# we assume success to prevent spamming SMS during testing.
165-
return True
166166

167167
from twilio.rest import Client
168168
twilio_client = Client(os.environ['TWILIO_ACCOUNT_SID'], os.environ['TWILIO_AUTH_TOKEN'])

0 commit comments

Comments
 (0)