'Test backport of the whole tree of related elements.'

@mock.patch('cinder.objects.base.LOG.debug')
def test_serialize_entity_full_backport(self, log_debug_mock):

    serializer = objects.base.CinderObjectSerializer('1.3')
    primitive = serializer.serialize_entity(self.context, self.parent_list)
    self.assertEqual('1.0', primitive['versioned_object.version'])
    parent = primitive['versioned_object.data']['objects'][0]
    self.assertEqual('1.0', parent['versioned_object.version'])
    data = parent['versioned_object.data']
    self.assertNotIn('scheduled_at', data)
    child = parent['versioned_object.data']['child']
    self.assertEqual('1.1', child['versioned_object.version'])
    data = child['versioned_object.data']
    self.assertNotIn('integer', data)
    self.assertEqual('text', data['text'])
    log_debug_mock.assert_has_calls([mock.call(self.BACKPORT_MSG, {'obj_name': 'ParentObjectList', 'src_vers': '1.1', 'dst_vers': '1.0'}), mock.call(self.BACKPORT_MSG, {'obj_name': 'ParentObject', 'src_vers': '1.1', 'dst_vers': '1.0'}), mock.call(self.BACKPORT_MSG, {'obj_name': 'ChildObject', 'src_vers': '1.2', 'dst_vers': '1.1'})])
