Example #1
0
 def test_get_message(self):
     mail = Mail()
     response = mail.get_message(
         'forgot_password.html',
         ['http://example.com', 'http://example.com']
     )
     self.assertIn('<a href="http://example.com">http://example.com</a>',
                   response)
Example #2
0
 def test_send_registration(self):
     mail = Mail()
     response = mail.send_registration(
         {
             'to': '*****@*****.**',
             'subject': 'Test Subject'
         },
         values=['Test User', '*****@*****.**', '*****@*****.**']
     )
     json_dict = json.loads(response.content.decode('utf-8'))
     self.assertIsInstance(json_dict, dict)
     self.assertEqual(json_dict['message'], "Queued. Thank you.")
Example #3
0
 def test_send_forgot_password(self):
     mail = Mail()
     response = mail.send_forgot_password(
         {
             'to': '*****@*****.**',
             'from': '*****@*****.**',
             'subject': 'Test Subject'
         },
         values=['http://example.com', 'http://example.com']
     )
     json_dict = json.loads(response.content.decode('utf-8'))
     self.assertIsInstance(json_dict, dict)
     self.assertEqual(json_dict['message'], "Queued. Thank you.")
Example #4
0
 def test_send_email(self):
     mail = Mail()
     response = mail.send_email(
         {
             'to': '*****@*****.**',
             'from': '*****@*****.**',
             'subject': 'Test Subject',
             'text': 'This is a test message.'
         }
     )
     json_dict = json.loads(response.content.decode('utf-8'))
     self.assertIsInstance(json_dict, dict)
     self.assertEqual(json_dict['message'], "Queued. Thank you.")