'Render the template specified by template_name with the given context.
For use in Django\'s test suite.'

def render_to_string(self, template_name, context=None):

    if isinstance(template_name, (list, tuple)):
        t = self.select_template(template_name)
    else:
        t = self.get_template(template_name)
    if isinstance(context, Context):
        return t.render(context)
    else:
        return t.render(Context(context))
