Created
August 29, 2012 19:58
-
-
Save aezell/3518040 to your computer and use it in GitHub Desktop.
Mock Twilio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@patch('twilio.rest.resources.SmsMessages') | |
def test_send_sms_valid_args(self, MockClass): | |
instance = MockClass.return_value | |
instance.create.return_value = None | |
to_number = 5555555555 | |
msg = 'Hello world' | |
send_sms(to_number, msg) | |
instance.create.assert_called_once_with(to='+1' + str(to_number), | |
body=msg, from_=settings.TWILIO_FROM_NUM) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment