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)
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.")
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.")
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.")