mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Add the Mandrill send API response to EmailMessage as a property, mandrill_response, when a message is sent. For errors, set mandrill_response to None. Add tests & docs.
This commit is contained in:
@@ -10,9 +10,13 @@ class DjrillBackendMockAPITestCase(TestCase):
|
||||
|
||||
class MockResponse:
|
||||
"""requests.post return value mock sufficient for DjrillBackend"""
|
||||
def __init__(self, status_code=200, content="{}"):
|
||||
def __init__(self, status_code=200, content="{}", json=['']):
|
||||
self.status_code = status_code
|
||||
self.content = content
|
||||
self._json = json
|
||||
|
||||
def json(self):
|
||||
return self._json
|
||||
|
||||
def setUp(self):
|
||||
self.patch = patch('requests.post', autospec=True)
|
||||
|
||||
Reference in New Issue
Block a user