Drop unintended json date encoding

This commit is contained in:
medmunds
2015-11-29 14:42:12 -08:00
parent 699216ba00
commit 942a6df8c3
4 changed files with 18 additions and 84 deletions

View File

@@ -529,7 +529,7 @@ class DjrillMandrillFeatureTests(DjrillBackendMockAPITestCase):
self.assertEqual(sent, 0)
self.assertIsNone(msg.mandrill_response)
def test_json_serialization_warnings(self):
def test_json_serialization_errors(self):
"""Try to provide more information about non-json-serializable data"""
self.message.global_merge_vars = {'PRICE': Decimal('19.99')}
with self.assertRaisesMessage(
@@ -539,6 +539,12 @@ class DjrillMandrillFeatureTests(DjrillBackendMockAPITestCase):
):
self.message.send()
def test_dates_not_serialized(self):
"""Pre-2.0 Djrill accidentally serialized dates to ISO"""
self.message.global_merge_vars = {'SHIP_DATE': date(2015, 12, 2)}
with self.assertRaises(TypeError):
self.message.send()
@override_settings(MANDRILL_SETTINGS={
'from_name': 'Djrill Test',