'Tests trying to delete a cell which has instance mappings.'

def test_delete_cell_instance_mappings_exist(self):

    cell_uuid = uuidutils.generate_uuid()
    ctxt = context.get_admin_context()
    cm = objects.CellMapping(context=ctxt, uuid=cell_uuid, database_connection='fake:///db', transport_url='fake:///mq')
    cm.create()
    im = objects.InstanceMapping(context=ctxt, instance_uuid=uuidutils.generate_uuid(), cell_mapping=cm, project_id=uuidutils.generate_uuid())
    im.create()
    self.assertEqual(3, self.commands.delete_cell(cell_uuid))
    output = self.output.getvalue().strip()
    self.assertIn('There    are    existing    instances    mapped    to    cell', output)
