Code

Opened 7 years ago

Closed 7 years ago

#4955 closed (wontfix)

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

Reported by: snhorne@… Owned by: adrian
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:

Description

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:

django.test.client.Client
tests.regressiontests.test_client_regress.models
docs/testing.txt

Attachments (3)

test_client_py.patch (876 bytes) - added by snhorne@… 7 years ago.
django.test.client
test_client_regress_models_py.patch (1007 bytes) - added by snhorne@… 7 years ago.
tests.regressiontests.test_client_regress.models
testing_txt.patch (1.9 KB) - added by starr horne <snhorne@…> 7 years ago.
/docs/testing.txt

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by snhorne@…

django.test.client

Changed 7 years ago by snhorne@…

tests.regressiontests.test_client_regress.models

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

/docs/testing.txt

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

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

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

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 7 years ago by russellm

  • Resolution set to wontfix
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.