'A rendering that takes more than a desired response time marks the
document as in need of deferred rendering in the future.'

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

    config.KUMASCRIPT_TIMEOUT = 1.0
    rendered_content = self.rendered_content
    def my_kumascript_get(self, cache_control, base_url, timeout):
        time.sleep(1.0)
        return (rendered_content, None)
    mock_kumascript_get.side_effect = my_kumascript_get
    config.KUMA_DOCUMENT_FORCE_DEFERRED_TIMEOUT = 2.0
    self.d1.render('', 'http://testserver/')
    ok_((not self.d1.defer_rendering))
    config.KUMA_DOCUMENT_FORCE_DEFERRED_TIMEOUT = 0.5
    self.d1.render('', 'http://testserver/')
    ok_(self.d1.defer_rendering)
    config.KUMASCRIPT_TIMEOUT = 0.0
