'Call /json/subscriptions/exist on an existing private stream with
autosubscribe should fail.'

def test_existing_subscriptions_autosubscription_private_stream(self):

    stream_name = 'Saxony'
    result = self.common_subscribe_to_streams(self.example_email('cordelia'), [stream_name], invite_only=True)
    stream = get_stream(stream_name, self.test_realm)
    result = self.client_post('/json/subscriptions/exists', {'stream': stream_name, 'autosubscribe': 'true'})
    self.assert_json_error(result, "Invalid    stream    name    'Saxony'", status_code=404)
    self.assertEqual(Subscription.objects.filter(recipient__type=Recipient.STREAM, recipient__type_id=stream.id).count(), 1)
    self.login(self.example_email('cordelia'))
    result = self.client_post('/json/subscriptions/exists', {'stream': stream_name, 'autosubscribe': 'false'})
    self.assert_json_success(result)
    json = ujson.loads(result.content)
    self.assertIn('subscribed', json)
    self.assertTrue(json['subscribed'])
