login_bare failing

43 views
Skip to first unread message

Richard

unread,
Apr 4, 2016, 12:57:13 PM4/4/16
to web2py-developers
Hello,

Anyone has an idea why this test is failing : 

self.assertEqual(self.auth.login_bare(username='user1', password='password_123')['username'], 'user1')


'user1' already exist and it verify with this :

self.assertEqual(self.db(self.db.auth_user.username == 'user1').select().first()['id'], 1)

I try to create other test but need to be logged in to make it working so it bring me bach to this failing test...

:(

Thanks

Richard

Leonel Câmara

unread,
Apr 4, 2016, 1:33:30 PM4/4/16
to web2py-developers
You are truncating the auth_user table in the previous test, you need to insert the user again.

Richard Vézina

unread,
Apr 4, 2016, 1:54:10 PM4/4/16
to web2py-d...@googlegroups.com
No, I test that... And I think setUp() get call for every test as it a fixture... I thought that it could be because of lack of session... I will test it...

On Mon, Apr 4, 2016 at 1:33 PM, Leonel Câmara <leonel...@gmail.com> wrote:
You are truncating the auth_user table in the previous test, you need to insert the user again.

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Vézina

unread,
Apr 4, 2016, 4:08:28 PM4/4/16
to web2py-d...@googlegroups.com
Nothing better when puting session in self...

Also try this :
self.auth.settings.registration_requires_verification = False
self.auth.settings.registration_requires_approval = False

At the end of setUp()

Richard

Richard Vézina

unread,
Apr 5, 2016, 11:30:32 PM4/5/16
to web2py-d...@googlegroups.com
I think the way I was creating user (manual insert) was not appropriate, maybe I was missing some RBAC stuff like default group or things like that which prevent the login_bare() from working properly...

I am glad I finally make it works as it may help resolve the issue reported by Michele earlier today.

:)

Richard
Reply all
Reply to author
Forward
0 new messages