'Call /json/subscriptions/exist on an existing stream and autosubscribe to it.'

def test_existing_subscriptions_autosubscription(self):

    stream_name = 'new_public_stream'
    result = self.common_subscribe_to_streams(self.example_email('cordelia'), [stream_name], invite_only=False)
    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.assertFalse(json['subscribed'])
    result = self.client_post('/json/subscriptions/exists', {'stream': stream_name, 'autosubscribe': 'true'})
    self.assert_json_success(result)
    json = ujson.loads(result.content)
    self.assertIn('subscribed', json)
    self.assertTrue(json['subscribed'])
