Skip to content

Commit cc249ef

Browse files
committed
Test to check the dict (and nested dictionaries) can be JSON serialized. This test fails.
1 parent b8325fc commit cc249ef

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

embedly/tests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import unicode_literals
22
import unittest
3+
import json
34

45
from embedly.client import Embedly
56
from embedly.models import Url
@@ -72,6 +73,10 @@ def test_model(self):
7273
self.assertTrue(obj.images[0].width is 275)
7374
self.assertTrue(obj.images[0].nothing is None)
7475
self.assertTrue(obj.object.type is None)
76+
def test_model_data_can_serialize(self):
77+
obj = Url({'a': {'key': 'value'}})
78+
unserialzed = json.loads(json.dumps(obj.data))
79+
self.assertDictEqual(obj.data, unserialzed)
7580

7681
def test_provider(self):
7782
http = Embedly(self.key)

0 commit comments

Comments
 (0)