Opened 7 years ago

Closed 7 years ago

#25808 closed New feature (wontfix)

Setting to allow django.test.Client default requests to follow=True

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

Description

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.

Change History (4)

comment:1 Changed 7 years ago by Simon Charette

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?

comment:2 in reply to:  1 Changed 7 years ago by Adam

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)

comment:3 Changed 7 years ago by Tim Graham

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?

comment:4 Changed 7 years ago by Tim Graham

Resolution: wontfix
Status: newclosed

Closing as wontfix pending a stronger rationale for the feature.

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