title: Django : Testing if the page has redirected to the desired url
body: <p>In my django app, I have an authentication system. So, If I do not log in and try to access some profile's personal info, I get redirected to a login page. </p>
  
  <p>Now, I need to write a test case for this. The responses from the browsers I get is :      </p>
  
  <pre><code>GET /myprofile/data/some_id/ HTTP/1.1 302 0
  GET /account/login?next=/myprofile/data/some_id/ HTTP/1.1 301 0
  GET /account/login?next=/myprofile/data/some_id/ HTTP/1.1 200 6533
  </code></pre>
  
  <p>How do I write my test ? This what I have so far:</p>
  
  <pre><code>self.client.login(user="user", password="passwd")
  response = self.client.get('/myprofile/data/some_id/')
  self.assertEqual(response.status,200)
  self.client.logout()
  response = self.client.get('/myprofile/data/some_id/')
  </code></pre>
  
  <p>What could possibly come next ?</p>