'Gets the next message that was sent to the channel during the test,
or None if no message is available.
If require is true, will fail the test if no message is received.'

def get_next_message(self, channel, alias=DEFAULT_CHANNEL_LAYER, require=False):

    (recv_channel, content) = channel_layers[alias].receive_many([channel])
    if (recv_channel is None):
        if require:
            self.fail((u'Expected    a    message    on    channel    %s,    got    none' % channel))
        else:
            return None
    return Message(content, recv_channel, channel_layers[alias])
