'Test that unique constraints will work with delete operation.
To remove potential races on creation we have a constraint set on name
and race_preventer fields, and we set value on creation to 0, so 2
clusters with the same name will fail this constraint.  On deletion we
change this field to the same value as the id which will be unique and
will not conflict with the creation of another cluster with the same
name.'

def test_cluster_create_not_duplicate(self):

    cluster = utils.create_cluster(self.ctxt)
    self.assertIsNone(db.cluster_destroy(self.ctxt, cluster.id))
    self.assertIsNotNone(utils.create_cluster(self.ctxt, name=cluster.name))
