예제 #1
0
    def test_leave(self):
        """ convenience: should Hangup to a url via POST """
        r = VoiceResponse()
        r.leave()

        assert_equal(
            self.strip(r),
            '<?xml version="1.0" encoding="UTF-8"?><Response><Leave /></Response>'
        )
예제 #2
0
    def test_response(self):
        r = VoiceResponse()
        r.hangup()
        r.leave()
        r.sms('twilio sms', to='+11234567890', from_='+10987654321')

        assert_equal(
            self.strip(r),
            '<?xml version="1.0" encoding="UTF-8"?><Response><Hangup /><Leave /><Sms from="+10987654321" to="+11234567890">twilio sms</Sms></Response>'
        )
예제 #3
0
from twilio.twiml.voice_response import Leave, VoiceResponse

response = VoiceResponse()
response.leave()

print(response)