Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2016-02-23 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by timgraham):

 The idea is to change the default authentication backend to reject
 inactive users (#25232). Then we'll proceed with this patch so that
 someone who wants to allow inactive users to login won't be thwarted by
 the existing check in the test client.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.15fa730c8018a957f9dcd5ca610cb1ad%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2016-02-18 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by hobarrera):

 > However, the AuthenticationForm used by the login() view (which is the
 default) does perform this check, as do the permission-checking methods
 such as has_perm() and the authentication in the Django admin. All of
 those functions/methods will return False for inactive users.

 I think it makes sense for inactive users to get rejected; it's the result
 you'd get while using the whole default stack (eg: backend + view + form).

 My first thought is that your tests should use `force_login`, or maybe
 override `login()` to use your own login view+form combination.

 Another, more flexible, but more appropriate fix is for `login()` to log
 in users by posting to `LOGIN_URL`, which makes sure that tests use the
 exact same thing as what your application uses. This might be more effort,
 but makes tests far more consistent for everyone.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.45c795a69c1ca5a539906279e7105cd0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2016-02-16 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by sasha0):

 * cc: sasha@… (added)
 * needs_better_patch:  1 => 0
 * needs_tests:  1 => 0
 * needs_docs:  1 => 0


Comment:

 [https://github.com/django/django/pull/6124 PR]

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.e4a90a828ac5d992866ff6feae4dac68%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-08-10 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by timgraham):

 #25232 might allow removing the check in the test client `login()` method.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.e00ab474ee581949aff62c8c5ee05e07%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-16 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by jdufresne):

 > If the login solution proposed in #20916 will meet your use case, I find
 that better than adding an attribute to test.Client as I think the latter
 will be difficult to use (requiring initializing the test client on your
 own).

 I agree. I will continue work on the other ticket/PR. If you prefer to
 close this, I have no problem with that.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.1450f2a40b22fe6c67d1f7d86f258555%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-16 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by timgraham):

 If the login solution proposed in #20916 will meet your use case, I find
 that better than adding an attribute to `test.Client` as I think the
 latter will be difficult to use (requiring initializing the test client on
 your own).

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.d5b1e8793cd73b7f77632b35ff775b97%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-16 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"8050e6282e4daee24758a4a1c6c2fa938957bef2" 8050e62]:
 {{{
 #!CommitTicketReference repository=""
 revision="8050e6282e4daee24758a4a1c6c2fa938957bef2"
 [1.8.x] Refs #24987 -- Documented that Client.login() rejects inactive
 users.

 Backport of fbc618c13cc72b9c2f4c8dfd5ef8b8ab5a5d7caa from master
 }}}

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.88d1adf9619543aa73abcbcd6ef06566%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-16 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"fbc618c13cc72b9c2f4c8dfd5ef8b8ab5a5d7caa" fbc618c]:
 {{{
 #!CommitTicketReference repository=""
 revision="fbc618c13cc72b9c2f4c8dfd5ef8b8ab5a5d7caa"
 Refs #24987 -- Documented that Client.login() rejects inactive users.
 }}}

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.caab1d1cd76198a5e0465817fbb69e30%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-16 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by jdufresne):

 > However, your current change is backwards incompatible and will break
 many users' tests. I therefore don't consider it a bug but a feature
 request.
 >
 > One idea that comes to mind, of how to solve the problem in a backwards
 compatible manner, would be a flag on the client check_is_active=True that
 would allow to bypass the check.

 Understood about backwards incompatible concern. I can investigate coding
 this idea if there is agreement that it is the best approach.

 > How about documenting this for now?

 So long as the limitation exists, makes sense. You're diff looks good to
 me.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.fa0bf4cd994a2ce1c3f6bd6263cf50aa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-16 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by timgraham):

 How about documenting this for now?

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.07ec05296125c6c7f1e7870a72060995%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-16 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * Attachment "24987-doc.diff" added.


--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.1363f4753d941c5a779558ea933cace5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-16 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
-+-
 Reporter:  jdufresne|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by MarkusH):

 * needs_docs:  0 => 1
 * needs_better_patch:  0 => 1
 * needs_tests:  0 => 1
 * stage:  Unreviewed => Someday/Maybe


Comment:

 I tend to follow Claude's reasoning in #19792. I, personally expect
 `client.login()` to behave like `contrib.auth.login()`, thus checking for
 `is_active=True`. I see your point though.

 However, your current change is backwards incompatible and will break many
 users' tests. I therefore don't consider it a bug but a feature request.

 One idea that comes to mind, of how to solve the problem in a backwards
 compatible manner, would be a flag on the client `check_is_active=True`
 that would allow to bypass the check.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.12e2792a9b2e60c247a965abbd8f3a49%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-15 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
---+--
 Reporter:  jdufresne  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  master
 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
---+--

Comment (by jdufresne):

 Hmm. This may be a duplicate of previous ticket #19792. Sorry, my searches
 didn't reveal this originally. Obviously, I disagree with the final
 conclusion of wontfix in that ticket.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.7c4669b6a314177be3bd0b01c0ea7b3e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-15 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
---+--
 Reporter:  jdufresne  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  master
 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 jdufresne):

 * has_patch:  0 => 1


Comment:

 > I'm not sure if we'd consider this a bug or a feature that requires
 backwards compatibility

 If you decide on this let me know and I can change my approach. Until
 then, I'll take the path of least resistance. I have created a PR that
 treats this as a bug.

 https://github.com/django/django/pull/4864

 > but another option to solve your use case might be #20916.

 This is interesting. I will take a look at this as well. Thanks.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.736482f35c9e40aa4c501b48c3487c12%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24987: django.test.client.Client.login() rejects user with is_active=False

2015-06-15 Thread Django
#24987: django.test.client.Client.login() rejects user with is_active=False
---+--
 Reporter:  jdufresne  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  master
 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 timgraham):

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


Comment:

 Check was added in #4526 without much of an explanation, but it matches
 the check in `AuthenticationForm` so that's probably the reasoning. I'm
 not sure if we'd consider this a bug or a feature that requires backwards
 compatibility, but another option to solve your use case might be #20916.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.4e749d9a2926537fb4c621b9d7a5024f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.