Opened 2 months ago

Closed 5 weeks ago

#34757 closed New feature (fixed)

AsyncClient should follow redirects

Reported by: Mike Lissner Owned by: Olivier Tabone
Component: Testing framework Version: 4.2
Severity: Normal Keywords: async
Cc: Carlton Gibson, Andrew Godwin Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the documentation, it says the "AsyncClient has the same methods and signatures as the synchronous (normal) test client," except, "The follow parameter is not supported."

I searched Github and the tickets here, but couldn't find an explanation for this or a ticket discussing it. Is adding support for redirects something that's planned so that async tests of views that do redirects are possible?

Thanks as always for everything.

Change History (9)

comment:1 Changed 2 months ago by Mariusz Felisiak

Cc: Carlton Gibson Andrew Godwin added
Type: UncategorizedNew feature

Adding support for follow would required implementing an async version of _handle_redirects(). I'm not sure if it's possible.

comment:2 Changed 2 months ago by Carlton Gibson

Triage Stage: UnreviewedAccepted

Adding support for follow would required implementing an async version of ​_handle_redirects(). I'm not sure if it's possible.

I can't immediately see why not, so I'd say let's let someone have a pop at it. (The core loop fetching the chain of responses should work equivalently AFAICS, at a quick glance.)

comment:3 Changed 2 months ago by Olivier Tabone

Owner: changed from nobody to Olivier Tabone
Status: newassigned

I'll have a look at this one

comment:4 Changed 6 weeks ago by Olivier Tabone

Has patch: set

PR

Please review this PR

Cheers,

  • Olivier

comment:5 Changed 6 weeks ago by Mariusz Felisiak

Patch needs improvement: set

comment:6 Changed 6 weeks ago by Mariusz Felisiak <felisiak.mariusz@…>

In a9e0f3d3:

Refs #34757 -- Moved HTTP redirect logic to django.test.client.ClientMixin.

comment:7 Changed 6 weeks ago by Olivier Tabone

Patch needs improvement: unset

PR updated

comment:8 Changed 5 weeks ago by Mariusz Felisiak

Triage Stage: AcceptedReady for checkin

comment:9 Changed 5 weeks ago by Mariusz Felisiak <felisiak.mariusz@…>

Resolution: fixed
Status: assignedclosed

In 3f8dbe2:

Fixed #34757 -- Added support for following redirects to AsyncClient.

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