def test_substitution_data(): email_message = EmailMessage( to=[ { "address": "*****@*****.**", "substitution_data": { "key": "value" } } ], from_email='*****@*****.**' ) email_message.template = 'template-id' email_message.substitution_data = {"key2": "value2"} actual = SparkPostMessage(email_message) expected = dict( recipients=[ { "address": "*****@*****.**", "substitution_data": { "key": "value" } } ], from_email='*****@*****.**', template='template-id', substitution_data={"key2": "value2"} ) assert actual == expected
def test_template(): email_message = EmailMessage(to=['*****@*****.**'], from_email='*****@*****.**') email_message.template = 'template-id' actual = SparkPostMessage(email_message) expected = dict(recipients=['*****@*****.**'], from_email='*****@*****.**', template='template-id') assert actual == expected
def test_template(): email_message = EmailMessage( to=['*****@*****.**'], from_email='*****@*****.**' ) email_message.template = 'template-id' actual = SparkPostMessage(email_message) expected = dict( recipients=['*****@*****.**'], from_email='*****@*****.**', template='template-id' ) assert actual == expected
def test_substitution_data(): email_message = EmailMessage(to=[{ "address": "*****@*****.**", "substitution_data": { "key": "value" } }], from_email='*****@*****.**') email_message.template = 'template-id' email_message.substitution_data = {"key2": "value2"} actual = SparkPostMessage(email_message) expected = dict(recipients=[{ "address": "*****@*****.**", "substitution_data": { "key": "value" } }], from_email='*****@*****.**', template='template-id', substitution_data={"key2": "value2"}) assert actual == expected