#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 by Mariusz Felisiak, 16 months ago

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 by Carlton Gibson, 16 months ago

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 by Olivier Tabone, 16 months ago

Owner: changed from nobody to Olivier Tabone
Status: newassigned

I'll have a look at this one

comment:4 by Olivier Tabone, 15 months ago

Has patch: set

PR

Please review this PR

Cheers,

  • Olivier

comment:5 by Mariusz Felisiak, 15 months ago

Patch needs improvement: set

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 15 months ago

In a9e0f3d3:

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

comment:7 by Olivier Tabone, 15 months ago

Patch needs improvement: unset

PR updated

comment:8 by Mariusz Felisiak, 15 months ago

Triage Stage: AcceptedReady for checkin

comment:9 by Mariusz Felisiak <felisiak.mariusz@…>, 15 months ago

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