'Document view should serve up rendered content when available'

@mock.patch('kuma.wiki.kumascript.get')
def test_rendered_content(self, mock_kumascript_get):

    mock_kumascript_get.return_value = (self.rendered_content, None)
    resp = self.client.get(self.url, follow=False)
    p = pq(resp.content)
    txt = p.find('#wikiArticle').text()
    ok_((self.rendered_content in txt))
    ok_((self.raw_content not in txt))
    eq_(0, p.find('#doc-rendering-in-progress').length)
    eq_(0, p.find('#doc-render-raw-fallback').length)
