def test_twilio_callback(phone_number, status):
    actual = twilio_callback('1234', phone_number)
    expected = {
        'To': phone_number,
        'MessageStatus': status,
        'MessageSid': '1234',
    }
    assert actual == expected
示例#2
0
def test_delivered_twilio_callback(phone_number):
    assert twilio_callback('1234', phone_number) == {
        "AccountSid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "ApiVersion": "2010-04-01",
        "From": "+14155552345",
        "MessageSid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "MessageStatus": "delivered",
        "SmsSid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "SmsStatus": "delivered",
        "To": phone_number,
    }