mirror of
https://github.com/django/django.git
synced 2025-01-03 06:55:47 +00:00
Fixed mail.tests.MailTests.test_backend_arg() test on Python 3.13+.
There is no point in asserting Python error messages.
This commit is contained in:
parent
e99187e5c9
commit
4ee68bb4f5
@ -29,7 +29,6 @@ from django.core.mail.message import BadHeaderError, sanitize_address
|
|||||||
from django.test import SimpleTestCase, override_settings
|
from django.test import SimpleTestCase, override_settings
|
||||||
from django.test.utils import requires_tz_support
|
from django.test.utils import requires_tz_support
|
||||||
from django.utils.translation import gettext_lazy
|
from django.utils.translation import gettext_lazy
|
||||||
from django.utils.version import PY311
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from aiosmtpd.controller import Controller
|
from aiosmtpd.controller import Controller
|
||||||
@ -822,13 +821,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase):
|
|||||||
filebased.EmailBackend,
|
filebased.EmailBackend,
|
||||||
)
|
)
|
||||||
|
|
||||||
if sys.platform == "win32" and not PY311:
|
msg = " not object"
|
||||||
msg = (
|
|
||||||
"_getfullpathname: path should be string, bytes or os.PathLike, not "
|
|
||||||
"object"
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
msg = "expected str, bytes or os.PathLike object, not object"
|
|
||||||
with self.assertRaisesMessage(TypeError, msg):
|
with self.assertRaisesMessage(TypeError, msg):
|
||||||
mail.get_connection(
|
mail.get_connection(
|
||||||
"django.core.mail.backends.filebased.EmailBackend", file_path=object()
|
"django.core.mail.backends.filebased.EmailBackend", file_path=object()
|
||||||
|
Loading…
Reference in New Issue
Block a user