'Calling POST /json/users/me/subscriptions on behalf of another principal (for
whom you have permission to add subscriptions) should successfully add
those subscriptions and send a message to the subscribee notifying
them.'

def assert_adding_subscriptions_for_principal(self, invitee_email, invitee_realm, streams, invite_only=False):

    other_profile = get_user(invitee_email, invitee_realm)
    current_streams = self.get_streams(invitee_email, invitee_realm)
    self.assertIsInstance(other_profile, UserProfile)
    self.assertNotEqual(len(current_streams), 0)
    self.assertNotEqual(len(streams), 0)
    streams_to_sub = streams[:1]
    streams_to_sub.extend(current_streams)
    self.helper_check_subs_before_and_after_add(streams_to_sub, {'principals': ujson.dumps([invitee_email])}, streams[:1], current_streams, invitee_email, streams_to_sub, invitee_realm, invite_only=invite_only)
    msg = self.get_last_message()
    self.assertEqual(msg.recipient.type, msg.recipient.STREAM)
    self.assertEqual(msg.subject, u'hello')
    self.assertEqual(msg.sender.email, settings.WELCOME_BOT)
    self.assertIn('Welcome    to    #**', msg.content)
