#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 prestontimmons):
A documentation patch seems reasonable to me. Admittedly, though, I never
use this feature or `assertTemplateUsed`, so I don't know how important
having included and extended templates added is.
That gives us these options:
1. Document that it doesn't work
2. Add in support at the backend level for just the top-level template.
3. Add instrumentation support at the backend level for included/extended
templates.
Option 1 and 2 are straightforward. Option 3 is ugly but equivalent to
what `django.test.utils.setup_test_environment` does to Django currently.
It would need to be implemented via a sort of setup and teardown method on
the backend that monkeypatches the internal render method.
I vote for option 1. My reason being that it's not worth partially
implementing the feature nor monkeypatching Jinja2 to make it work fully.
--
Ticket URL: <https://code.djangoproject.com/ticket/24622#comment:4>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.b807da756050453099e9564f4ec4f59d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.