'Verify support for searching a stream you\'re not subscribed to'

@override_settings(USING_PGROONGA=False)
def test_get_messages_with_search_not_subscribed(self):

    self.subscribe_to_stream(self.example_email('hamlet'), 'newstream')
    self.send_message(sender_name=self.example_email('hamlet'), raw_recipients='newstream', message_type=Recipient.STREAM, content='Public    special    content!', subject='new')
    self._update_tsvector_index()
    self.login(self.example_email('cordelia'))
    stream_search_narrow = [dict(operator='search', operand='special'), dict(operator='stream', operand='newstream')]
    stream_search_result = self.get_and_check_messages(dict(narrow=ujson.dumps(stream_search_narrow), anchor=0, num_after=10, num_before=10))
    self.assertEqual(len(stream_search_result['messages']), 1)
    self.assertEqual(stream_search_result['messages'][0]['match_content'], '<p>Public    <span    class="highlight">special</span>    content!</p>')
