Clean up and document Anymail's test EmailBackend

* Change Anymail's test EmailBackend to collect sent messages in
  django.core.mail.outbox, same as Django's own locmem EmailBackend.
  (So Django's test runner will automatically clear accumulated mail
  between test cases.)

* Rename EmailMessage `test_response` attr to `anymail_test_response`
  to avoid conflicts, and record merged ESP send params in
  new `anymail_send_params` attr.

* Add docs

Closes #36.
This commit is contained in:
medmunds
2017-09-01 13:13:25 -07:00
parent a9c663f36a
commit 2faa5f96cb
6 changed files with 106 additions and 42 deletions

View File

@@ -100,7 +100,7 @@ class TestPostSendSignal(TestBackendTestCase):
self.receiver_called = True
self.addCleanup(post_send.disconnect, receiver=handle_post_send)
self.message.test_response = {
self.message.anymail_test_response = {
'recipient_status': {
'to@example.com': AnymailRecipientStatus(message_id=None, status='rejected')
}