'When creating a subscription, the desktop and audible notification
settings for that stream are derived from the global notification
settings.'

def test_subscriptions_add_notification_default_true(self):

    user_profile = self.example_user('iago')
    invitee_email = user_profile.email
    invitee_realm = user_profile.realm
    user_profile.enable_stream_desktop_notifications = True
    user_profile.enable_stream_sounds = True
    user_profile.save()
    current_stream = self.get_streams(invitee_email, invitee_realm)[0]
    invite_streams = self.make_random_stream_names([current_stream])
    self.assert_adding_subscriptions_for_principal(invitee_email, invitee_realm, invite_streams)
    subscription = self.get_subscription(user_profile, invite_streams[0])
    with mock.patch('zerver.models.Recipient.__unicode__', return_value='recip'):
        self.assertEqual(str(subscription), (u'<Subscription:    <UserProfile:    %s    <Realm:    zulip    1>>    ->    recip>' % (self.example_email('iago'),)))
    self.assertTrue(subscription.desktop_notifications)
    self.assertTrue(subscription.audible_notifications)
