'Sets an alias to point to a new ChannelLayerWrapper instance, and
returns the old one that it replaced. Useful for swapping out the
backend during tests.'

def set(self, key, layer):

    old = self.backends.get(key, None)
    self.backends[key] = layer
    return old
