Move all the payload construction into Payload classes

This commit is contained in:
medmunds
2016-03-04 15:55:19 -08:00
parent dbf57d8a33
commit 3b414a9619
5 changed files with 395 additions and 316 deletions

View File

@@ -29,7 +29,7 @@ class DjrillBackendMockAPITestCase(TestCase):
self.raw = six.BytesIO(raw)
def setUp(self):
self.patch = patch('requests.Session.post', autospec=True)
self.patch = patch('requests.Session.request', autospec=True)
self.mock_post = self.patch.start()
self.mock_post.return_value = self.MockResponse()

View File

@@ -559,7 +559,7 @@ class DjrillMandrillFeatureTests(DjrillBackendMockAPITestCase):
self.message.send()
err = cm.exception
self.assertTrue(isinstance(err, TypeError)) # Djrill 1.x re-raised TypeError from json.dumps
self.assertStrContains(str(err), "Don't know how to send this data to your ESP") # our added context
self.assertStrContains(str(err), "Don't know how to send this data to Mandrill") # our added context
self.assertStrContains(str(err), "Decimal('19.99') is not JSON serializable") # original message
def test_dates_not_serialized(self):