Re: Getting Logged in User with Test Client

2009-01-29 Thread Vitaly Babiy
Malcolm thanks for the feedback and your right, I agree with you that the client should not know about the user. Vitaly Babiy 2009/1/26 Malcolm Tredinnick > > On Sat, 2009-01-24 at 12:14 -0500, Vitaly Babiy wrote: > > Yes either way would work I was just wondering if there was a more > > clean

Re: Getting Logged in User with Test Client

2009-01-26 Thread Malcolm Tredinnick
On Sat, 2009-01-24 at 12:14 -0500, Vitaly Babiy wrote: > Yes either way would work I was just wondering if there was a more > cleaner way of doing so. Then you're going to have to define what "cleaner" means from your persepctive. What could be cleaner that simply get()-ing the right model based

Re: Getting Logged in User with Test Client

2009-01-24 Thread Vitaly Babiy
Yes either way would work I was just wondering if there was a more cleaner way of doing so. Vitaly Babiy On Sat, Jan 24, 2009 at 11:47 AM, Masklinn wrote: > > On 24 Jan 2009, at 06:22 , Vbabiy wrote: > > > >def test_showAccountWithZeroTrackers(self): > >self.client.login(username='

Re: Getting Logged in User with Test Client

2009-01-24 Thread Masklinn
On 24 Jan 2009, at 06:22 , Vbabiy wrote: > >def test_showAccountWithZeroTrackers(self): >self.client.login(username='user', password='test123') > > How can I get the user model when I use the client to login in to the > application? > Why not simply use `User.objects.get(username='user

Re: Getting Logged in User with Test Client

2009-01-24 Thread Nathaniel Whiteinge
On Jan 23, 10:22 pm, Vbabiy wrote: > How can I get the user model when I use the client to login in to the > application? This method is a little ugly, but it works:: from django.contrib.auth.models import User def test_showAccountWithZeroTrackers(self): self.client.login(userna

Getting Logged in User with Test Client

2009-01-23 Thread Vbabiy
def test_showAccountWithZeroTrackers(self): self.client.login(username='user', password='test123') How can I get the user model when I use the client to login in to the application? --~--~-~--~~~---~--~~ You received this message because you are subscri