1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Adjusted expected exception message for Windows.

Test failure introduced in fbbff7f808.

Windows uses a different error message when a non-path is passed to
os.path functions.
This commit is contained in:
Jon Dufresne 2019-11-06 05:34:44 -08:00 committed by Carlton Gibson
parent 4c45b627f8
commit e3c2fae4cd

View File

@ -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)