Here are the examples of the python api django.test.RequestFactory.head taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
3
View Complete Implementation : tests.py
Copyright GNU Affero General Public License v3.0
Author : nesdis
Copyright GNU Affero General Public License v3.0
Author : nesdis
def test_no_head(self):
"""
ConditionalGetMiddleware shouldn't compute and return an ETag on a
HEAD request since it can't do so accurately without access to the
response body of the corresponding GET.
"""
request = RequestFactory().head('/')
response = HttpResponse(status=200)
conditional_get_response = ConditionalGetMiddleware().process_response(request, response)
self.astertNotIn('ETag', conditional_get_response)