Skip to content

Commit

Permalink
Merge pull request aaronn#59 from timstallmann/timstallmann-better-te…
Browse files Browse the repository at this point in the history
…sting-for-mobile

Minor for testing with mobile workflow
  • Loading branch information
aaronn committed Apr 17, 2020
2 parents 9f08f55 + 21a7147 commit 6a634bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drfpasswordless/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ def send_sms_with_callback_token(user, mobile_token, **kwargs):
Passes silently without sending in test environment.
"""
if api_settings.PASSWORDLESS_TEST_SUPPRESSION is True:
# we assume success to prevent spamming SMS during testing.
return True

base_string = kwargs.get('mobile_message', api_settings.PASSWORDLESS_MOBILE_MESSAGE)

try:

if api_settings.PASSWORDLESS_MOBILE_NOREPLY_NUMBER:
# We need a sending number to send properly
if api_settings.PASSWORDLESS_TEST_SUPPRESSION is True:
# we assume success to prevent spamming SMS during testing.
return True

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

0 comments on commit 6a634bf

Please sign in to comment.