示例#1
0
 def test_unserialize_references(self):
     alpha, beta, refs = self._create_bags()
     ref = dict(alpha=alpha, beta=beta)
     serialized_refs = serialize_references(ref)
     unserialized_refs = unserialize_references(serialized_refs)
     self.assertEqual(unserialized_refs['alpha'].pk, alpha.pk)
     self.assertEqual(unserialized_refs['beta'].pk, beta.pk)
 def test_unserialize_references(self):
     alpha, beta, refs = self._create_bags()
     ref = dict(alpha=alpha, beta=beta)
     serialized_refs = serialize_references(ref)
     unserialized_refs = unserialize_references(serialized_refs)
     self.assertEqual(unserialized_refs['alpha'].pk, alpha.pk)
     self.assertEqual(unserialized_refs['beta'].pk, beta.pk)
示例#3
0
 def test_serialize_references_edge_cases(self):
     self.assertEquals(serialize_references(None), {})
     self.assertEquals(serialize_references({ 'test': 'test' }), { 'test': 'test' })
示例#4
0
 def test_serialize_references_edge_cases(self):
     self.assertEquals(serialize_references(None), {})
     self.assertEquals(serialize_references({'test': 'test'}),
                       {'test': 'test'})