Trigger an exception in the template machinery which causes a SafeString to be inserted as args[0] of the Exception.
(request)
| 89 | |
| 90 | |
| 91 | def safestring_in_template_exception(request): |
| 92 | """ |
| 93 | Trigger an exception in the template machinery which causes a SafeString |
| 94 | to be inserted as args[0] of the Exception. |
| 95 | """ |
| 96 | template = Template('{% extends "<script>alert(1);</script>" %}') |
| 97 | try: |
| 98 | template.render(Context()) |
| 99 | except Exception: |
| 100 | return technical_500_response(request, *sys.exc_info()) |
| 101 | |
| 102 | |
| 103 | def jsi18n(request): |
nothing calls this directly
no test coverage detected