'Call ``DELETE /projects/{project_id}``.
As well as making sure the delete succeeds, we ensure
that any credentials that reference this projects are
also deleted, while other credentials are unaffected.'

def test_delete_project(self):

    credential = unit.new_credential_ref(user_id=self.user['id'], project_id=self.project_id)
    self.credential_api.create_credential(credential['id'], credential)
    r = self.credential_api.get_credential(credential['id'])
    self.assertDictEqual(credential, r)
    project2 = unit.new_project_ref(domain_id=self.domain['id'])
    self.resource_api.create_project(project2['id'], project2)
    credential2 = unit.new_credential_ref(user_id=self.user['id'], project_id=project2['id'])
    self.credential_api.create_credential(credential2['id'], credential2)
    self.delete(('/projects/%(project_id)s' % {'project_id': self.project_id}))
    self.assertRaises(exception.CredentialNotFound, self.credential_api.get_credential, credential_id=credential['id'])
    r = self.credential_api.get_credential(credential2['id'])
    self.assertDictEqual(credential2, r)
