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:
Eric Hennings
2013-12-22 14:12:57 -08:00
parent 08141a3003
commit e1c78ec197
4 changed files with 62 additions and 3 deletions

View File

@@ -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)