Document that test.client.RequestFactory doesn't support sessions or request-altering middleware
Since #15736 has been closed "wontfix", I think it could be classified as a documentation problem:
the RequestFactory docs at
http://docs.djangoproject.com/en/dev/topics/testing/#the-request-factory
make it sound like RequestFactory().get() creates a request that is equivalent to that used by TestClient.get().
But this is not true - TestClient goes out of its way to handle django.contrib.session, and loads middleware; RequestFactory does neither - and based on the response to #15736 that's by design.
So that should be explicit in the docs.
Attachments
(1)
- 15876.diff
(527 bytes
) - added by ShawnMilo 14 years ago.
- Documentation patch to make lack of middleware support explicit.
Download all attachments as:
.zip
Change History
(7)
Triage Stage: |
Unreviewed → Accepted
|
Triage Stage: |
Accepted → Ready for checkin
|
Owner: |
changed from nobody to ShawnMilo
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Documentation patch to make lack of middleware support explicit.