https://github.com/django/django/blob/master/django/test/client.py#L635
I think this could be improved. Libraries like `django-rules` are
implemented as an authentication backend but don't implement a `get_user`
method. This leads to confusing errors, as described in this ticket:
https://github.com/dfunckt/django-rules/issues/46
Perhaps rather than doing `backend = settings.AUTHENTICATION_BACKENDS[0]`
it could filter out backends that don't implement a `get_user` method, or
follow the usual chain of authentication backends (i.e skipping ones that
return None)?
--
Ticket URL: <https://code.djangoproject.com/ticket/27542>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: New feature => Cleanup/optimization
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/27542#comment:1>
* cc: django@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/27542#comment:2>
* cc: desecho@… (added)
* has_patch: 0 => 1
* version: 1.10 => master
Comment:
Added [https://github.com/django/django/pull/7634 PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/27542#comment:3>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"47744a0a4ed0b9e2d3f52de65abcf6cef9a14e31" 47744a0a]:
{{{
#!CommitTicketReference repository=""
revision="47744a0a4ed0b9e2d3f52de65abcf6cef9a14e31"
Fixed #27542 -- Made Client.force_login() skip auth backends without
get_user().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27542#comment:4>