1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Updated email message headers to have 'Date' and 'Message-Id' fields (#4693) (#4695)

This commit is contained in:
Jacob Minnis
2016-12-03 18:56:42 -06:00
committed by Paulus Schoutsen
parent efdf51b542
commit c89e6ec915
2 changed files with 9 additions and 3 deletions

View File

@@ -34,16 +34,18 @@ class TestNotifySmtp(unittest.TestCase):
def test_text_email(self):
"""Test build of default text email behavior."""
msg = self.mailer.send_message('Test msg')
expected = ('Content-Type: text/plain; charset="us-ascii"\n'
expected = ('^Content-Type: text/plain; charset="us-ascii"\n'
'MIME-Version: 1.0\n'
'Content-Transfer-Encoding: 7bit\n'
'Subject: Home Assistant\n'
'To: testrecip@test.com\n'
'From: test@test.com\n'
'X-Mailer: HomeAssistant\n'
'Date: [^\n]+\n'
'Message-Id: <[^@]+@[^>]+>\n'
'\n'
'Test msg')
self.assertEqual(msg, expected)
'Test msg$')
self.assertRegex(msg, expected)
def test_mixed_email(self):
"""Test build of mixed text email behavior."""