[Django] #27027: force_login() now requires an authentication backend if multiple are configured

4 views
Skip to first unread message

Django

unread,
Aug 5, 2016, 8:21:38 PM8/5/16
to django-...@googlegroups.com
#27027: force_login() now requires an authentication backend if multiple are
configured
-----------------------------------+--------------------
Reporter: bendemboski | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------
I believe this was an unintentionally-breaking change introduced in the
[https://github.com/django/django/commit/b6433866682baac35a953e59298dff7f399ac49b
fix for #24855]. The
[https://github.com/django/django/commit/b6433866682baac35a953e59298dff7f399ac49b
#diff-97160f50594424a40f2621d5a3c581ccL606 code] in the test client's
`force_login()` that chooses a default authentication backend as the first
one in settings was removed, but the
[https://github.com/django/django/commit/b6433866682baac35a953e59298dff7f399ac49b
#diff-82ec6fd74a1cab41408fbf5bf0998f58R115 new code] added to the
`login()` method throws an exception if no backend is specified and
multiple are configured in settings.

The result is that applications with multiple authentications backends
that were previously using `force_login()` without specifying a backend
are broken when running on 1.10, and need to be updated to specify a
backend. This doesn't seem like it's in keeping with the intent of the
`force_login()` test client helper, but if it is it should at least be
documented as a (test code) breaking change.

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

Django

unread,
Aug 5, 2016, 8:23:54 PM8/5/16
to django-...@googlegroups.com
#27027: force_login() now requires an authentication backend if multiple are
configured
-----------------------------------+--------------------------------------

Reporter: bendemboski | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

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


Comment:

Pull request addressing this here:
https://github.com/django/django/pull/7034

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

Django

unread,
Aug 6, 2016, 8:42:24 AM8/6/16
to django-...@googlegroups.com
#27027: force_login() now requires an authentication backend if multiple are
configured
-----------------------------------+--------------------------------------
Reporter: bendemboski | Owner: nobody
Type: Bug | Status: closed

Component: Testing framework | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"fc8f097117af7ada616fad20ae5b417fcf740413" fc8f097]:
{{{
#!CommitTicketReference repository=""
revision="fc8f097117af7ada616fad20ae5b417fcf740413"
Fixed #27027 -- Restored Client.force_login() defaulting to the first auth
backend.
}}}

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

Django

unread,
Aug 6, 2016, 8:57:47 AM8/6/16
to django-...@googlegroups.com
#27027: force_login() now requires an authentication backend if multiple are
configured
-----------------------------------+--------------------------------------
Reporter: bendemboski | Owner: nobody
Type: Bug | Status: closed

Component: Testing framework | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"d68b145a6f6e5e5dc1775cdaa904d83ee28ed615" d68b145]:
{{{
#!CommitTicketReference repository=""
revision="d68b145a6f6e5e5dc1775cdaa904d83ee28ed615"
[1.10.x] Fixed #27027 -- Restored Client.force_login() defaulting to the
first auth backend.

Backport of fc8f097117af7ada616fad20ae5b417fcf740413 from master
}}}

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

Reply all
Reply to author
Forward
0 new messages