'Test that claim fails if the work entry has changed its status.'

def test_worker_claim_fails_status_change(self):

    worker = db.worker_create(self.ctxt, resource_type='Volume', resource_id=fake.VOLUME_ID, status='deleting')
    worker.status = 'creating'
    res = db.worker_claim_for_cleanup(self.ctxt, 1, worker)
    self.assertEqual(0, res)
    db_worker = db.worker_get(self.ctxt, id=worker.id)
    self._assertEqualObjects(worker, db_worker, ['status'])
    self.assertIsNone(db_worker.service_id)
