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

def test_delete_cell_host_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()
    hm = objects.HostMapping(context=ctxt, host='fake-host', cell_mapping=cm)
    hm.create()
    self.assertEqual(2, self.commands.delete_cell(cell_uuid))
    output = self.output.getvalue().strip()
    self.assertIn('There    are    existing    hosts    mapped    to    cell', output)
