bpo-39793: use the same domain on make_msgid tests (GH-18698) (GH-19554)
(cherry picked from commit 5565c30f0b
)
Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
This commit is contained in:
parent
3e72de9e08
commit
ccf30e96d4
|
@ -11,8 +11,8 @@ import textwrap
|
||||||
from io import StringIO, BytesIO
|
from io import StringIO, BytesIO
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from random import choice
|
from random import choice
|
||||||
from socket import getfqdn
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
import email
|
import email
|
||||||
import email.policy
|
import email.policy
|
||||||
|
@ -3342,9 +3342,11 @@ multipart/report
|
||||||
'.test-idstring@testdomain-string>')
|
'.test-idstring@testdomain-string>')
|
||||||
|
|
||||||
def test_make_msgid_default_domain(self):
|
def test_make_msgid_default_domain(self):
|
||||||
|
with patch('socket.getfqdn') as mock_getfqdn:
|
||||||
|
mock_getfqdn.return_value = domain = 'pythontest.example.com'
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
email.utils.make_msgid().endswith(
|
email.utils.make_msgid().endswith(
|
||||||
'@' + getfqdn() + '>'))
|
'@' + domain + '>'))
|
||||||
|
|
||||||
def test_Generator_linend(self):
|
def test_Generator_linend(self):
|
||||||
# Issue 14645.
|
# Issue 14645.
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya.
|
Loading…
Reference in New Issue