'Check that messages sent to a stream reach all subscribers to that stream.'

def assert_stream_message(self, stream_name, subject='test    subject', content='test    content'):

    realm = get_realm('zulip')
    subscribers = self.users_subscribed_to_stream(stream_name, realm)
    subscribers = [subscriber for subscriber in subscribers if (subscriber.bot_type != UserProfile.OUTGOING_WEBHOOK_BOT)]
    old_subscriber_messages = []
    for subscriber in subscribers:
        old_subscriber_messages.append(message_stream_count(subscriber))
    non_subscribers = [user_profile for user_profile in UserProfile.objects.all() if (user_profile not in subscribers)]
    old_non_subscriber_messages = []
    for non_subscriber in non_subscribers:
        old_non_subscriber_messages.append(message_stream_count(non_subscriber))
    non_bot_subscribers = [user_profile for user_profile in subscribers if (not user_profile.is_bot)]
    a_subscriber_email = non_bot_subscribers[0].email
    self.login(a_subscriber_email)
    self.send_message(a_subscriber_email, stream_name, Recipient.STREAM, subject, content)
    new_subscriber_messages = []
    for subscriber in subscribers:
        new_subscriber_messages.append(message_stream_count(subscriber))
    new_non_subscriber_messages = []
    for non_subscriber in non_subscribers:
        new_non_subscriber_messages.append(message_stream_count(non_subscriber))
    self.assertEqual(old_non_subscriber_messages, new_non_subscriber_messages)
    self.assertEqual(new_subscriber_messages, [(elt + 1) for elt in old_subscriber_messages])
