Skip to content

Commit 4609d53

Browse files
felixxmsarahboyce
authored andcommitted
[5.0.x] Fixed mail.tests.MailTests.test_backend_arg() test on Python 3.13+.
There is no point in asserting Python error messages. Backport of 4ee68bb from main.
1 parent 83ec18b commit 4609d53

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

tests/mail/tests.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from django.test import SimpleTestCase, override_settings
3030
from django.test.utils import requires_tz_support
3131
from django.utils.translation import gettext_lazy
32-
from django.utils.version import PY311
3332

3433
try:
3534
from aiosmtpd.controller import Controller
@@ -791,13 +790,7 @@ def test_backend_arg(self):
791790
filebased.EmailBackend,
792791
)
793792

794-
if sys.platform == "win32" and not PY311:
795-
msg = (
796-
"_getfullpathname: path should be string, bytes or os.PathLike, not "
797-
"object"
798-
)
799-
else:
800-
msg = "expected str, bytes or os.PathLike object, not object"
793+
msg = " not object"
801794
with self.assertRaisesMessage(TypeError, msg):
802795
mail.get_connection(
803796
"django.core.mail.backends.filebased.EmailBackend", file_path=object()

0 commit comments

Comments
 (0)