From e3c2fae4cd549a6aeefcf7b217ba4b173489e18c Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Wed, 6 Nov 2019 05:34:44 -0800 Subject: [PATCH] Adjusted expected exception message for Windows. Test failure introduced in fbbff7f80870bc3e98de4a2fc9cd853949842fd0. Windows uses a different error message when a non-path is passed to os.path functions. --- tests/mail/tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/mail/tests.py b/tests/mail/tests.py index 567a012b8d..84aa8dc498 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -569,7 +569,10 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): filebased.EmailBackend ) - msg = 'expected str, bytes or os.PathLike object, not object' + if sys.platform == 'win32': + 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): mail.get_connection('django.core.mail.backends.filebased.EmailBackend', file_path=object()) self.assertIsInstance(mail.get_connection(), locmem.EmailBackend)