Please ignore the previous message. I think I am too sleepy now, and am seeing things which do not exist. :) .
On Feb 22, 11:57 pm, shabda <[EMAIL PROTECTED]> wrote: > Aww, I seems a call to c.get('/dashboard/') gets an object of type > HttpResponse while c.get('/dashboard/', {}) gets a Response object. > > On Feb 22, 11:50 pm, shabda <[EMAIL PROTECTED]> wrote: > > > I have some test code written like, > > > def testDashBoard(self): > > c = Client() > > print c.login(username = 'Shabda', password= 'shabda') > > response = c.get('/dashboard/') > > print response.headers['X-View'] > > > This is giving me error > > > ================================================================== > > ERROR: testDashBoard (prajact.project.tests.TestUrls) > > ------------------------------------------------------------------ > > Traceback (most recent call last): > > File "G:\prajact\project\tests.py", line 822, in testDashBoard > > print response.headers['X-View'] > > AttributeError: 'HttpResponse' object has no attribute 'headers' > > > But according to the documentation c.get must return objects of type > > reponse, and not HttpReponse. What am I doing wrong? > > > Also I want the test client to follow the HttpReponseRedirects, so > > that I can see the actual view which the user will see, but the test > > client does not do this by default. How can I do this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---