diff --git a/tests/mail/file.txt b/tests/mail/file.txt
new file mode 100644
index 0000000..e69de29
diff --git a/tests/mail/tests.py b/tests/mail/tests.py
index 75d5dd6..3b6c2d3 100644
a
|
b
|
from django.core.mail import (
|
20 | 20 | from django.core.mail.backends import console, dummy, filebased, locmem, smtp |
21 | 21 | from django.core.mail.message import BadHeaderError |
22 | 22 | from django.test import SimpleTestCase, override_settings |
| 23 | from django.utils._os import upath |
23 | 24 | from django.utils.encoding import force_bytes, force_text |
24 | 25 | from django.utils.six import PY3, StringIO, binary_type |
25 | 26 | from django.utils.translation import ugettext_lazy |
… |
… |
class MailTests(HeadersCheckMixin, SimpleTestCase):
|
305 | 306 | payload = message.get_payload() |
306 | 307 | self.assertEqual(payload[1].get_filename(), 'une pièce jointe.pdf') |
307 | 308 | |
| 309 | def test_attach_file(self): |
| 310 | email = EmailMessage('subject', 'body', 'from@example.com', ['to@example.com']) |
| 311 | email.attach_file(os.path.join(os.path.dirname(upath(__file__)), 'file.txt')) |
| 312 | email.send() |
| 313 | |
308 | 314 | def test_dummy_backend(self): |
309 | 315 | """ |
310 | 316 | Make sure that dummy backends returns correct number of sent messages |