def test_deserialize(self):
        payload = [{'natural_key': {'charfield': 'bar'}, 'collection': ChildDocument._meta.collection, 'fields': {'charfield': u'bar'}},
                   {'natural_key': {'uuid': 'DEADBEEF'}, 'collection': ParentDocument._meta.collection, 'fields': {'subdocument': {'charfield': 'bar'}, 'title': u'foo'}}]
        objects = list(Deserializer(payload))
        self.assertEqual(len(objects), 2)
        obj = objects[1]
        #assert False, str(obj.object.to_primitive(obj.object))
        self.assertEqual(obj.object['title'], 'foo')

        saved_objects = list()
        for obj in objects:
            saved_obj = obj.save()
            self.assertTrue(saved_obj._primitive_data in '@natural_key_hash')
            self.assertTrue(saved_obj.pk)
            saved_objects.append(saved_obj)

        for obj in saved_objects:
            obj.normalize_portable_primitives()
            obj.save()

        #assert False, saved_objects[0]._primitive_data['@natural_key_hash'] #-5545305821442551595
        self.assertEqual(saved_objects[1].subdocument, saved_objects[0])

        subdoc = saved_objects[1]._primitive_data['subdocument']
        self.assertEqual(subdoc, saved_objects[0].pk)
dataset/ETHPy150Open zbyte64/django-dockit/dockit/tests/serializers/python_tests.py/PythonSerializerTestCase.test_deserialize/swapped operands of `in`