[Django] #25808: Setting to allow django.test.Client default requests to follow=True

20 views
Skip to first unread message

Django

unread,
Nov 24, 2015, 11:29:12 AM11/24/15
to django-...@googlegroups.com
#25808: Setting to allow django.test.Client default requests to follow=True
-----------------------------------+--------------------
Reporter: awwester | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------
There should be a way to allow the django.test.Client to default its
requests to follow=True instead of having to mark it in each request.
Something in settings `TEST_AUTO_FOLLOW = True` would trigger it as an
opt-in setting.

--
Ticket URL: <https://code.djangoproject.com/ticket/25808>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 24, 2015, 12:04:33 PM11/24/15
to django-...@googlegroups.com
#25808: Setting to allow django.test.Client default requests to follow=True
-----------------------------------+--------------------------------------

Reporter: awwester | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by charettes):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

I'm not sure this use case is common enough to add yet another setting.

What about subclassing `django.test.Client` and using the
`TestCase.client_class` attribute instead?

--
Ticket URL: <https://code.djangoproject.com/ticket/25808#comment:1>

Django

unread,
Nov 24, 2015, 12:17:57 PM11/24/15
to django-...@googlegroups.com
#25808: Setting to allow django.test.Client default requests to follow=True
-----------------------------------+--------------------------------------

Reporter: awwester | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by awwester):

That's what I had tried before realizing that it wasn't a property on the
Client but rather the requests issued by the Client (.get(), .post(), etc)

--
Ticket URL: <https://code.djangoproject.com/ticket/25808#comment:2>

Django

unread,
Nov 24, 2015, 1:35:42 PM11/24/15
to django-...@googlegroups.com
#25808: Setting to allow django.test.Client default requests to follow=True
-----------------------------------+--------------------------------------

Reporter: awwester | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by timgraham):

I agree we shouldn't add a setting. What we could do a `default_follow`
class attribute to `Client` which would default to "unset" (e.g. `None`).
Then we'd also change the default of `follow` on the request method to
`None` and have them use `follow if follow is not None else
self.default_follow if self.default_follow is not None else None`. Is it
worth it?

--
Ticket URL: <https://code.djangoproject.com/ticket/25808#comment:3>

Django

unread,
Dec 2, 2015, 1:03:34 PM12/2/15
to django-...@googlegroups.com
#25808: Setting to allow django.test.Client default requests to follow=True
-----------------------------------+--------------------------------------
Reporter: awwester | Owner: nobody
Type: New feature | Status: closed

Component: Testing framework | Version: 1.8
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by timgraham):

* status: new => closed
* resolution: => wontfix


Comment:

Closing as wontfix pending a stronger rationale for the feature.

--
Ticket URL: <https://code.djangoproject.com/ticket/25808#comment:4>

Reply all
Reply to author
Forward
0 new messages