#24622: Response "context" and "templates" not available in the Test Client when using Jinja2 - Django 1.8 -------------------------------------+------------------------------------ Reporter: rivantis | Owner: nobody Type: Bug | Status: new Component: Testing framework | Version: 1.8 Severity: Normal | Resolution: Keywords: jinja2, test client | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------
Comment (by carljm): Oh yes, Armin did mention that he intentionally doesn't provide any hooks into anything context-related after the initial render, so it seems that's not likely to change. A couple approaches he mentioned that we could look into: ``` 22:11 < mitsuhiko> if you want to intercept the context somehow, you could do things 22:11 < mitsuhiko> but it's pretty ugly 22:11 < mitsuhiko> you can set a custom template_class on the environment 22:11 < mitsuhiko> and then in that template class you patch root_render_func and all funcs in blocks 22:11 < mitsuhiko> as they are passed the context 22:12 < mitsuhiko> maybe you also get away with overriding new_context ``` -- Ticket URL: <https://code.djangoproject.com/ticket/24622#comment:7> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.1e805f5824052b9c01378b4c1fdf7641%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.