I am having issues with django test
Posted
by Mohamed
on Stack Overflow
See other posts from Stack Overflow
or by Mohamed
Published on 2010-03-28T02:10:06Z
Indexed on
2010/03/28
2:13 UTC
Read the original article
Hit count: 294
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)
the view associated with the test case is this
@login_required
def student(request):
return render_to_response('student/controlpanel.html')
so my question is why the above test case redirects user to login page? should not c.login suppose to take care authenticating user?
© Stack Overflow or respective owner