This doesn't answer your question, but it may help you solve the problem. I have this class in my tests:
class LoggedInUser(TestCase): def setUp(self): user = User.objects.create_user(USER, 'm...@nowhere.com', PASS) self.client.login(username=user.username, password=PASS) response = self.client.get('/experiment/import') def test_experiment_list(self): response = self.client.get('/experiments') self.failUnlessEqual(response.status_code, 200) This works for me... I haven't tried it your way, so I don't know what is going wrong there. - Paulo On Sun, Mar 28, 2010 at 5:17 AM, Rolando Espinoza La Fuente < dark...@gmail.com> wrote: > On Sat, Mar 27, 2010 at 9:30 PM, Mohamed Ainab <myai...@gmail.com> wrote: > > I have this test case > > > > def test_loginin_student_control_panel(self): > > c = Client() > > c.login(username="tauri", password="gaul") > > response = c.get('/student/') > > self.assertEqual(response.status_code, 200) > > Was the user created? > Has is_active flag? > You have django.contrib.sessions in your INSTALLED_APPS? > > c.login() returns False is login was unsuccessful. > > Hope it helps. Regards, > > ~Rolando > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.