def render(self, string, context=None, request_context=True):
        if context is None:
            context = {}

        # Add a request to the template, to simulate a RequestContext
        if request_context:
            if 'site' in context:
                site = context['site']
            else:
                site = Site.objects.get(is_default_site=True)

            request = self.client.get('/test/', HTTP_HOST=site.hostname)
            request.site = site
            context['request'] = request

        template = self.engine.from_string(string)
        return template.render(context)
dataset/ETHPy150Open torchbox/wagtail/wagtail/contrib/settings/tests/test_templates.py/TestSettingsJinja.render/original