List Info

Thread: Best practice: How to test site using openid-only login




Best practice: How to test site using openid-only login
country flaguser name
United States
2007-05-29 11:40:09
Hi,

I'd like to ask about best testing practice. I'm looking at
test
client in SVN, which looks great for most of cases and I can
get rid
of Selenium (great tool, but slow). TestClient looks
promising, but I
don't knew how to authorize(), when site is only using
OpenID login.

Any suggestions? (I'd like to use as less workaround/hacks
as
possible)

Thanks,

Almad


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Best practice: How to test site using openid-only login
user name
2007-05-29 11:46:42
You might take a look at twill (http://twill.idyll.org/)
- Although I
find it a tad trickier to get rolling with than Selenium, it
has the
functionality that you want (emulating a browser, including
cookies)
and can be 'programmed' to walk to an OpenID login site and
back again
following redirects. You can think of it as a more
complex/complete
version of the test client in Django.

If that doesn't suit, consider one of the browser automation
engines -
Pamie, Samie, or Watir. Given that you're programming python
already,
Pamie (http://pamie.sourceforg
e.net/) is probably of more interest.
It's basically driving "IE" on windows through
it's COM interface.

-joe



On 5/29/07, Almad <bugsalmad.net> wrote:
>
> Hi,
>
> I'd like to ask about best testing practice. I'm
looking at test
> client in SVN, which looks great for most of cases and
I can get rid
> of Selenium (great tool, but slow). TestClient looks
promising, but I
> don't knew how to authorize(), when site is only using
OpenID login.
>
> Any suggestions? (I'd like to use as less
workaround/hacks as
> possible)
>
> Thanks,
>
> Almad
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Best practice: How to test site using openid-only login
country flaguser name
United States
2007-05-29 11:55:21

On May 29, 6:46 pm, "Joseph Heck"
<joseph.h...gmail.com> wrote:
> You might take a look at twill (http://twill.idyll.org/)
- Although I
> find it a tad trickier to get rolling with than
Selenium, it has the
> functionality that you want (emulating a browser,
including cookies)
> and can be 'programmed' to walk to an OpenID login site
and back again
> following redirects. You can think of it as a more
complex/complete
> version of the test client in Django.

I knew, but also django client is much faster 

> -joe


And, sorry for disturbing, I thought that client really
fills form &
co. However, I just passed openid_url instead of
identity_url to
login() function and thus login failed.
I can just use login() to pass it to my openid backend and
then I'm
logged in without need to go through openid verification
process.

Almad


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Best practice: How to test site using openid-only login
user name
2007-05-29 19:05:56
On 5/30/07, Almad <bugsalmad.net> wrote:
>
> On May 29, 6:46 pm, "Joseph Heck"
<joseph.h...gmail.com> wrote:
> > You might take a look at twill (http://twill.idyll.org/)
- Although I
> > find it a tad trickier to get rolling with than
Selenium, it has the
> > functionality that you want (emulating a browser,
including cookies)
> > and can be 'programmed' to walk to an OpenID login
site and back again
> > following redirects. You can think of it as a more
complex/complete
> > version of the test client in Django.
>
> I knew, but also django client is much faster 

There are also a lot of things the Django test client can't
do.
Anything relying upon client-side javascript, for example.

Like the docs say, it's not intended as the perfect ultimate
test
client - just as a way of doing simple view testing.

> And, sorry for disturbing, I thought that client really
fills form &
> co. However, I just passed openid_url instead of
identity_url to
> login() function and thus login failed.
> I can just use login() to pass it to my openid backend
and then I'm
> logged in without need to go through openid
verification process.

Until recently, login() did fill in a form - but it was a
very
specific form (the form from django.contrib.auth.views).

In [5152] (post 0.96 release), this was replaced with a
scheme that
avoids forms entirely. The test client now uses the
authentication
credentials directly to set up a session, set a session
cookie, etc.
This simulates the effect of logging in without actually
visiting a
specific login view.

Without knowing the specifics of your setup, if you have
OpenID set up
as an django.contrib.auth backend, you should be able to
provide the
OpenID credentials to the test client login method, which
will log in
the test client session.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )