Opened 2 years ago

Closed 2 years ago

#20864 closed Cleanup/optimization (fixed)

Test client should use common method when making requests

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

Description

Test client has a generic method, which is used to construct PUT, OPTIONS and PATCH requests. However it could be used also in GET, HEAD and POST methods, which would allow easier creation of custom test clients. For example, if one wants to create a client which adds a specific HTTP header to all requests, no matter what the method, he could do this by overriding only generic method. Now he has to override generic, post, head and get.

Change History (2)

comment:1 Changed 2 years ago by KJ

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I’ve created a pull request: https://github.com/django/django/pull/1438

comment:2 Changed 2 years ago by Tim Graham <timograham@…>

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

In 4eeb8ec147022d3a7360d9fa78d3cd1c76accfb1:

Fixed #20864 -- Made the test client use common method for performing requests.

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