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
1 changed files with 4 additions and 1 deletions

View File

@ -569,7 +569,10 @@ class MailTests(HeadersCheckMixin, SimpleTestCase):
filebased.EmailBackend 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): with self.assertRaisesMessage(TypeError, msg):
mail.get_connection('django.core.mail.backends.filebased.EmailBackend', file_path=object()) mail.get_connection('django.core.mail.backends.filebased.EmailBackend', file_path=object())
self.assertIsInstance(mail.get_connection(), locmem.EmailBackend) self.assertIsInstance(mail.get_connection(), locmem.EmailBackend)