Opened 11 years ago

Closed 11 years ago

#4955 closed (wontfix)

Feature: Allow unit tests to access test client's previous request object

Reported by: snhorne@… Owned by: Adrian Holovaty
Component: Testing framework Version: master
Severity: Keywords: Client test
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I've added 'previous_request' variable to django.test.client.Client. It holds the last WSGIRequest created by ClientHandler.

This is useful because it allows me to test certain middleware which alters the request.

I'm including patches for:


Attachments (3)

test_client_py.patch (876 bytes) - added by snhorne@… 11 years ago.
test_client_regress_models_py.patch (1007 bytes) - added by snhorne@… 11 years ago.
testing_txt.patch (1.9 KB) - added by starr horne <snhorne@…> 11 years ago.

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by snhorne@…

Attachment: test_client_py.patch added


Changed 11 years ago by snhorne@…


Changed 11 years ago by starr horne <snhorne@…>

Attachment: testing_txt.patch added


comment:1 Changed 11 years ago by starr horne <snhorne@…>

Oh. I forgot. All tests pass on my machine.

comment:2 Changed 11 years ago by John Shaffer <jshaffer2112@…>

Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 11 years ago by Russell Keith-Magee

Resolution: wontfix
Status: newclosed

I'm marking this a wontfix, because I'm don't understand the use case, and the test you provided doesn't shed any light on the issue. If you can clarify your use case, feel free to reopen the ticket.

As a housekeeping issue - this should be submitted as a single patch rooted at the base of the Django tree.

Note: See TracTickets for help on using tickets.
Back to Top