Feature Request: customize redirectable status codes in test client

2022-02-20 Thread Clemens Wolff
Hi Django Developers, I'd like to discuss a change to the Django test client to enable customizing the list of status codes that are considered as redirectable when a GET request is made with `follow=True` (see docs in [1]). Specifically, I suggest moving the `redirect_status_codes` property in t

Re: Feature Request: customize redirectable status codes in test client

2022-02-20 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
202 is not a redirect, and I can’t find any standard that says where the “next” URL can be found. So I don’t think there is a strong argument to make the test client “follow” it or allow _handle_redirects to support it. You’re free to subclass the test client in your own project to add support - ha

Re: Feature Request: customize redirectable status codes in test client

2022-02-20 Thread Clemens Wolff
Thanks for the reply. Indeed, HTTP 202 isn't a redirect, but quite a few APIs use it as a "work in progress" indicator with a Location header to point to the resource to be created. This isn't a standard, just something I found in the wild a fair few times. One documented instance I stumbled ac

Re: Fellow Reports - February 2022

2022-02-20 Thread Mariusz Felisiak
Week ending February 20, 2022 *Triaged: * https://code.djangoproject.com/ticket/33512 - Creating a child instance with a parent containing DateTimeField(auto_add_now=True) raises IntegrityError. (duplicate) https://code.djangoproject.com/ticket/33505 - Inconsistent Behavior with Abstrac