'A call to /json/invites with valid parameters unconditionally
subscribes the invitee to the notifications stream if it exists and is
public.'

def test_successful_invite_user_with_notifications_stream(self):

    realm = get_realm('zulip')
    notifications_stream = get_stream('Verona', realm)
    realm.notifications_stream = notifications_stream
    realm.save()
    self.login(self.example_email('hamlet'))
    invitee = 'alice-test@zulip.com'
    self.assert_json_success(self.invite(invitee, ['Denmark']))
    self.assertTrue(find_key_by_email(invitee))
    self.check_sent_emails([invitee])
    prereg_user = get_prereg_user_by_email(invitee)
    streams = list(prereg_user.streams.all())
    self.assertTrue((notifications_stream in streams))
