          Check that the token is inserted if there is a new session being started
          """
          req = self._get_GET_no_session_request() # no session in request
          resp = self._get_new_session_response() # but new session started
          resp_content = resp.content
          resp2 = CsrfMiddleware().process_response(req, resp)
          self.assertNotEqual(resp_content, resp2.content)
          self._check_token_present(resp2)
  
      # Check the request processing
 
</s> remove         resp_content = resp.content
 </s> add 	resp_content = resp.content # needed because process_response modifies resp </s> remove         resp_content = resp.content
 </s> add 	resp_content = resp.content # needed because process_response modifies resp </s> remove             # This covers a corner case in which the outgoing request
 </s> add             # This covers a corner case in which the outgoing response
	resp_content = resp.content # needed because process_response modifies resp
          Check that the token is inserted if there is a new session being started
          """
          req = self._get_GET_no_session_request() # no session in request
          resp = self._get_new_session_response() # but new session started
	resp_content = resp.content # needed because process_response modifies resp
          resp2 = CsrfMiddleware().process_response(req, resp)
          self.assertNotEqual(resp_content, resp2.content)
          self._check_token_present(resp2)
  
      # Check the request processing
keep keep keep keep replace keep keep keep keep keep
 Made CSRF middleware skip post-processing for 'csrf_exempt' decorated views.

This commit also decomposes the decorator into two decorators which can be
used separately, adds some tests, updates docs and fixes some code comments.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@9815 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/contrib/csrf/tests.py