#19792: django.test.client.Client.login() checking for is_active attribute on
User
objects
-----------------------------------+------------------------------------
Reporter: mrmagooey | Owner: slurms
Type: Bug | Status: assigned
Component: Testing framework | Version: 1.5-rc-1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------------------
Comment (by claudep):
On one side, I understand the issue, and the `is_active` check might be
inappropriate in the test client when using a custom auth backend.
On the other side, if the test client `login` method is meant to be
equivalent to the `contrib.auth.login` view, we have a problem with this
patch. The latter will refuse the login because it uses the
`AuthenticationForm` which checks the `is_active` flag, while the former
will let the user in (no more `is_active` check).
This might be solved by documenting the discrepancy between
`Client.login()` and `contrib.auth.login()`
(https://docs.djangoproject.com/en/dev/topics/testing/overview/#django.test.client.Client.login).
A release note would also be mandatory, as this would be slightly
backwards-incompatible.
--
Ticket URL: <https://code.djangoproject.com/ticket/19792#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.