Browse Source

[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 4ee68bb4f50dbe842461f8f340bb1633fddd4a53 from main.
Mariusz Felisiak 9 tháng trước cách đây
mục cha
commit
4609d53adb
1 tập tin đã thay đổi với 1 bổ sung8 xóa
  1. 1 8
      tests/mail/tests.py

+ 1 - 8
tests/mail/tests.py

@@ -29,7 +29,6 @@ from django.core.mail.message import BadHeaderError, sanitize_address
 from django.test import SimpleTestCase, override_settings
 from django.test.utils import requires_tz_support
 from django.utils.translation import gettext_lazy
-from django.utils.version import PY311
 
 try:
     from aiosmtpd.controller import Controller
@@ -791,13 +790,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase):
                 filebased.EmailBackend,
             )
 
-        if sys.platform == "win32" and not PY311:
-            msg = (
-                "_getfullpathname: path should be string, bytes or os.PathLike, not "
-                "object"
-            )
-        else:
-            msg = "expected str, bytes or os.PathLike object, not object"
+        msg = " not object"
         with self.assertRaisesMessage(TypeError, msg):
             mail.get_connection(
                 "django.core.mail.backends.filebased.EmailBackend", file_path=object()