'get_rendered() should return rendered content when available,
attempt a render() when it\'s not'

@override_config(KUMASCRIPT_TIMEOUT=1.0)
@mock.patch('kuma.wiki.kumascript.get')
def test_get_rendered(self, mock_kumascript_get):

    mock_kumascript_get.return_value = (self.rendered_content, None)
    ok_((not self.d1.rendered_html))
    ok_((not self.d1.render_started_at))
    ok_((not self.d1.last_rendered_at))
    (result_rendered, _) = self.d1.get_rendered(None, 'http://testserver/')
    ok_(mock_kumascript_get.called)
    eq_(self.rendered_content, result_rendered)
    eq_(self.rendered_content, self.d1.rendered_html)
    d1_fresh = Document.objects.get(pk=self.d1.pk)
    eq_(self.rendered_content, d1_fresh.rendered_html)
    ok_(d1_fresh.render_started_at)
    ok_(d1_fresh.last_rendered_at)
    mock_kumascript_get.called = False
    (result_rendered, _) = d1_fresh.get_rendered(None, 'http://testserver/')
    ok_((not mock_kumascript_get.called))
    eq_(self.rendered_content, result_rendered)
