Opened 6 years ago

Closed 6 years ago

#7583 closed (fixed)

Test client response object no longer includes "headers"

Reported by: mtredinnick Owned by: nobody
Component: Testing framework Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by mtredinnick)

(I bumped into this some weeks back and forgot to file the bug. Just hit it again.)

The testing docs say that the test client response has a headers attribute. This was true when HttpResponse had a headers attribute, but we nuked that last year ([6225], [6235] and [6456] are the main bits). The trivial change of fixing the documentation might not be the right solution here, though, since it turns out to be useful to be able to view the full response in testing (either debug printing or just listing out the values for comparison).

So, either

  1. we add a way to get the headers dict to HttpResponse (probably least preferable, since it's better for people to use get() there),
  2. add something in the test client end to provide the headers dictionary, or
  3. just remove that note from the docs and you have to know the header you're after (just like in normal code, I guess).

I'm going to be lazy and make this Somebody Else's Problem. Wanted to note it down whilst I remembered.

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by mtredinnick

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 6 years ago by russellm

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

(In [7900]) Fixed #7583 -- Corrected the testing docs that referred to the defunct headers attribute of the response. Added a test case to validate (and document) the new behavior. Thanks to Malcolm for the report.

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.