@@ -80,7 +80,6 @@ def test_sendgridAPIKey(self):
8080 else :
8181 self .fail ("Should have failed as SendGrid API key included" )
8282
83-
8483 def test_helloEmail (self ):
8584 self .max_diff = None
8685
@@ -130,7 +129,7 @@ def test_helloEmailAdditionalContent(self):
130129 personalization = Personalization ()
131130 personalization .add_to (Email ("test@example.com" ))
132131 mail .add_personalization (personalization )
133-
132+
134133 mail .add_content (Content ("text/html" , "<html><body>some text here</body></html>" ))
135134 mail .add_content (Content ("text/plain" , "some text here" ))
136135
@@ -562,3 +561,14 @@ def test_disable_tracking(self):
562561 def test_directly_setting_substitutions (self ):
563562 personalization = Personalization ()
564563 personalization .substitutions = [{'a' : 0 }]
564+
565+ def test_dynamic_template_data (self ):
566+ p = Personalization ()
567+ p .add_to (Email ('test@sendgrid.com' ))
568+ p .dynamic_template_data = {'customer' : {'name' : 'Bob' , 'returning' : True }, 'total' : 42 }
569+
570+ expected = {
571+ 'to' : [{'email' : 'test@sendgrid.com' }],
572+ 'dynamic_template_data' : {'customer' : {'name' : 'Bob' , 'returning' : True }, 'total' : 42 }
573+ }
574+ self .assertDictEqual (p .get (), expected )
0 commit comments