mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Un-hardcode message_id in test backend; add console backend
* Un-hardcode status message_id in test backend For the test EmailBackend, get message ID's based on array position in `mail.outbox`, so that tests can predict the message ID. * Add a console backend for use in development Adds an EmailBackend derived from both Anymail's test backend and Django's console backend, to provide anymail statuses and signal handling while printing messages to the console. For use during development on localhost. Closes #87
This commit is contained in:
committed by
Mike Edmunds
parent
09def30868
commit
771d4040df
@@ -65,9 +65,9 @@ class TestPostSendSignal(TestBackendTestCase):
|
||||
self.assertEqual(sender, TestEmailBackend)
|
||||
self.assertEqual(message, self.message)
|
||||
self.assertEqual(status.status, {'sent'})
|
||||
self.assertEqual(status.message_id, 1) # TestEmailBackend default message_id
|
||||
self.assertEqual(status.message_id, 0)
|
||||
self.assertEqual(status.recipients['to@example.com'].status, 'sent')
|
||||
self.assertEqual(status.recipients['to@example.com'].message_id, 1)
|
||||
self.assertEqual(status.recipients['to@example.com'].message_id, 0)
|
||||
self.assertEqual(esp_name, "Test") # the TestEmailBackend's ESP is named "Test"
|
||||
self.receiver_called = True
|
||||
self.addCleanup(post_send.disconnect, receiver=handle_post_send)
|
||||
|
||||
Reference in New Issue
Block a user