Skip to content

Commit

Permalink
Test for refs within arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Eoghan Murray authored and davvid committed Jun 19, 2011
1 parent bf1dc04 commit 5126524
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/jsonpickle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,15 @@ def test_object_dict_keys(self):
self.assertEqual(unpickled,
{u'samples.Thing("random")': True})

def test_list_of_objects(self):
"""Test that objects in lists are referenced correctly"""
a = Thing('a')
b = Thing('b')
pickled = jsonpickle.encode([a, b, b])
unpickled = jsonpickle.decode(pickled)
self.assertEqual(unpickled[1], unpickled[2])


def test_load_backend(self):
"""Test that we can call jsonpickle.load_backend()
Expand Down

0 comments on commit 5126524

Please sign in to comment.