﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29960	`render_to_string` passes `None` for `context` if unspecified, but `Template.render` expects type `Context`	Joshua Cannon	nobody	"I'm not sure if this is a bug bug or just misleading documentation, but the signature/docstring for `render_to_string` starts as follows:
{{{
def render_to_string(template_name, context=None, request=None, using=None):
    """"""
    Load a template and render it with a context. Return a string.
    ...
}}}

The docstring would lead the reader to believe the context isn't optional. If the caller omits `context`, they will likely get the following exception:
{{{AttributeError: 'NoneType' object has no attribute 'render_context'}}}

which is due to `Template.render`'s first line being:
{{{
def render(self, context):
        with context.render_context.push_state(self):
        ...
}}}

The signature of `Template.render` would lead me to believe context is not optional and must be of type `Context`."	Bug	closed	Template system	2.1	Normal	invalid	render_to_string, template, context		Unreviewed	0	0	0	0	0	0
