mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Prevent e-mails from being dispatched during tests.
This commit is contained in:
parent
0e4fb95a39
commit
c1e3007aa6
1 changed files with 5 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import mock
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from django_mailbox.models import Mailbox, Message
|
from django_mailbox.models import Mailbox, Message
|
||||||
|
|
@ -213,12 +214,14 @@ class TestProcessEmail(EmailMessageTestCase):
|
||||||
self.assertTrue(msg.outgoing)
|
self.assertTrue(msg.outgoing)
|
||||||
|
|
||||||
actual_from = 'username@example.com'
|
actual_from = 'username@example.com'
|
||||||
reply_email_object = EmailMessage('Test subject', # subject
|
reply_email_object = EmailMessage(
|
||||||
|
'Test subject', # subject
|
||||||
'Test body', # body
|
'Test body', # body
|
||||||
actual_from, # from
|
actual_from, # from
|
||||||
['mr.test32@mail.ru'], # to
|
['mr.test32@mail.ru'], # to
|
||||||
)
|
)
|
||||||
|
|
||||||
|
with mock.patch.object(reply_email_object, 'send'):
|
||||||
reply_msg = msg.reply(reply_email_object)
|
reply_msg = msg.reply(reply_email_object)
|
||||||
|
|
||||||
self.assertEqual(reply_msg.in_reply_to, msg)
|
self.assertEqual(reply_msg.in_reply_to, msg)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue