naming of a new test client method for logging in

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

naming of a new test client method for logging in

Tim Graham-2
There's a proposal [1] to add a new method to the test client that works like login(), but skips the authentication (no credentials need to be provided) and verification (is_active=False can login) steps. The signature is (user, backend=None). What would you name this method?

Proposals so far:
* force_login() (since this method bypasses authentication and other checks login() has)
* login_user() (since this method takes a user argument instead of credentials)

[1] https://github.com/django/django/pull/4865

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/896e32fc-67ea-4c56-ac90-b8e47a00c7ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: naming of a new test client method for logging in

Andriy Sokolovskiy (coldmind)-2
force_login() seems to be more clear what it going on inside

On 6/30/15 16:38, Tim Graham wrote:

> There's a proposal [1] to add a new method to the test client that works
> like login(), but skips the authentication (no credentials need to be
> provided) and verification (is_active=False can login) steps. The
> signature is (user, backend=None). What would you name this method?
>
> Proposals so far:
> * force_login() (since this method bypasses authentication and other
> checks login() has)
> * login_user() (since this method takes a user argument instead of
> credentials)
>
> [1] https://github.com/django/django/pull/4865
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> To post to this group, send email to [hidden email]
> <mailto:[hidden email]>.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/896e32fc-67ea-4c56-ac90-b8e47a00c7ea%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/896e32fc-67ea-4c56-ac90-b8e47a00c7ea%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/55929C72.3060008%40asokolovskiy.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: naming of a new test client method for logging in

Markus Holtermann
I second Andriy's comment.

/Markus

On Tue, Jun 30, 2015 at 04:41:06PM +0300, Andriy Sokolovskiy wrote:

>force_login() seems to be more clear what it going on inside
>
>On 6/30/15 16:38, Tim Graham wrote:
>> There's a proposal [1] to add a new method to the test client that works
>> like login(), but skips the authentication (no credentials need to be
>> provided) and verification (is_active=False can login) steps. The
>> signature is (user, backend=None). What would you name this method?
>>
>> Proposals so far:
>> * force_login() (since this method bypasses authentication and other
>> checks login() has)
>> * login_user() (since this method takes a user argument instead of
>> credentials)
>>
>> [1] https://github.com/django/django/pull/4865
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to [hidden email]
>> <mailto:[hidden email]>.
>> To post to this group, send email to [hidden email]
>> <mailto:[hidden email]>.
>> Visit this group at http://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/896e32fc-67ea-4c56-ac90-b8e47a00c7ea%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-developers/896e32fc-67ea-4c56-ac90-b8e47a00c7ea%40googlegroups.com?utm_medium=email&utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout.
>
>--
>You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>To post to this group, send email to [hidden email].
>Visit this group at http://groups.google.com/group/django-developers.
>To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/55929C72.3060008%40asokolovskiy.com.
>For more options, visit https://groups.google.com/d/optout.
--

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/20150630162053.GA5329%40pyler.local.
For more options, visit https://groups.google.com/d/optout.

attachment0 (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: naming of a new test client method for logging in

Berker Peksağ
In reply to this post by Tim Graham-2
On Tue, Jun 30, 2015 at 4:38 PM, Tim Graham <[hidden email]> wrote:
> There's a proposal [1] to add a new method to the test client that works
> like login(), but skips the authentication (no credentials need to be
> provided) and verification (is_active=False can login) steps. The signature
> is (user, backend=None). What would you name this method?
>
> Proposals so far:
> * force_login() (since this method bypasses authentication and other checks
> login() has)

+1 for force_login()

--Berker

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAF4280KNLaH6fdBrOQ3U6kRidhMeo%2B1iEpZeHKNJ9_r%2B4f46KA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: naming of a new test client method for logging in

Tim Graham-2
Okay, it seems I'm in the minority with my preference for login_user(). I've committed the patch with force_login(). Thanks for the feedback.

On Tuesday, June 30, 2015 at 4:34:11 PM UTC-4, Berker Peksag wrote:
On Tue, Jun 30, 2015 at 4:38 PM, Tim Graham <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="0huTH9B-7koJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">timog...@...> wrote:
> There's a proposal [1] to add a new method to the test client that works
> like login(), but skips the authentication (no credentials need to be
> provided) and verification (is_active=False can login) steps. The signature
> is (user, backend=None). What would you name this method?
>
> Proposals so far:
> * force_login() (since this method bypasses authentication and other checks
> login() has)

+1 for force_login()

--Berker

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/64c9e2b2-5934-45d0-9723-3e8b4c8ba7e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.