'An expired lease is logged.'

@capture_logging(None)
def test_expire_lease_logging(self, logger):

    node_id = uuid4()
    dataset_id = uuid4()
    leases = Leases().acquire(datetime.fromtimestamp(self.clock.seconds(), UTC), dataset_id, node_id, 1)
    d = self.persistence_service.save(Deployment(leases=leases))
    def saved(_):
        logger.reset()
        self.clock.advance(1000)
        assertHasMessage(self, logger, _LOG_EXPIRE, {u'dataset_id': dataset_id, u'node_id': node_id})
    d.addCallback(saved)
    return d
