'Call /json/subscriptions/exists on a stream and expect a certain result.'

def helper_subscriptions_exists(self, stream, expect_success, subscribed):

    result = self.client_post('/json/subscriptions/exists', {'stream': stream})
    json = ujson.loads(result.content)
    if expect_success:
        self.assert_json_success(result)
    else:
        self.assertEqual(result.status_code, 404)
    if subscribed:
        self.assertIn('subscribed', json)
        self.assertEqual(json['subscribed'], subscribed)
