Language: Python
Label: safe
CWE: NVD-CWE-noinfo \u2014 

Code:
    def test_safe_render(self):
        """Assert that safe Jinja rendering still works."""
        site = Site.objects.filter(region__isnull=False).first()
        template_code = "{{ obj.region.name }}"
        try:
            value = render_jinja2(template_code=template_code, context={"obj": site})
        except SecurityError:
            self.fail("SecurityError raised on safe Jinja template render")
        else:
            self.assertEqual(value, site.region.name)