'Determines whether we\'re correctly passing the realm context'

def test_render_mention_stream_api(self):

    content = 'This    mentions    #**Denmark**    and    @**King    Hamlet**.'
    result = self.client_post('/api/v1/messages/render', dict(content=content), **self.api_auth(self.example_email('othello')))
    self.assert_json_success(result)
    data = ujson.loads(result.content)
    user_id = self.example_user('hamlet').id
    self.assertEqual(data['rendered'], (u'<p>This    mentions    <a    class="stream"    data-stream-id="%s"    href="/#narrow/stream/Denmark">#Denmark</a>    and    <span    class="user-mention"    data-user-email="%s"    data-user-id="%s">@King    Hamlet</span>.</p>' % (get_stream('Denmark', get_realm('zulip')).id, self.example_email('hamlet'), user_id)))
