#15736: test.client.RequestFactory doesn't support sessions
---------------------------------------+---------------------------------
Reporter: slinkp | Owner: nobody
Type: New feature | Status: closed
Milestone: | Component: Testing framework
Version: 1.3 | Severity: Normal
Resolution: wontfix | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 |
---------------------------------------+---------------------------------
Changes (by carljm):
* status: new => closed
* component: Uncategorized => Testing framework
* type: Uncategorized => New feature
* resolution: => wontfix
Comment:
I think this would be the wrong direction for RequestFactory. In real
code, a bare request has no session attribute - that's added only by
SessionMiddleware, which is part of a contrib app, not even part of the
core framework. Your test failure is correctly telling you that your
helper function requires a request object that's been annotated with a
session attribute, so your test should explicitly do that annotation in
the test setup, if it's a unittest and not an end-to-end test that runs
the full request-response cycle (including middleware).
--
Ticket URL: <http://code.djangoproject.com/ticket/15736#comment:4>
Django <http://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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.