#24622: Response "context" and "templates" not available in the Test Client when
using Jinja2 - Django 1.8
-------------------------------------+-------------------------------------
     Reporter:  rivantis             |                    Owner:  Mat Moore
         Type:  Bug                  |                   Status:  assigned
    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
-------------------------------------+-------------------------------------
Changes (by Mat Moore):

 * owner:  nobody => Mat Moore
 * status:  new => assigned

Comment:

 Hi, I'd like to do some work on this issue, although I expect it will take
 me a while to make progress (I am a new contributor and the time I can
 spend coding is limited).

 Going back to the 3 options suggested #4, there are 2 that would resolve
 the issue:

 - Option 2: Add in support at the backend level for just the top-level
 template.
 - Option 3: Add instrumentation support at the backend level for
 included/extended templates.

 My reading of the discussion so far is that we would prefer to implement
 option 3 if feasible, otherwise we have inconsistent behaviour of the test
 client across backends. But if it's not feasible, is option 2 a good
 enough solution if we explicitly document the differences? The test client
 already behaves inconsistently, and partial support for testing template
 rendering seems better than none.

 The assumption is that option 3 requires some kind of monkey patching of
 Jinja2 internals, but I can have a look at the latest APIs as it's been a
 few years since anyone's looked into it.

 If we go with option 2, it sounds like the work involved will be:
 - start with Moritz Sichert's PR:
 https://github.com/django/django/pull/6194/changes
 - add tests and documentation to it
 - introduce a {{{setup_test_environment()}}} method to the backends

 Does that sound reasonable? Have I missed anything?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/24622#comment:29>
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 view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019b839eb94b-f17492fe-cb0b-42e9-baed-d5b106ab074c-000000%40eu-central-1.amazonses.com.

Reply via email to