def testGetCacheControlPragmaNoCache(self):
# Test Pragma: no-cache on requests
uri = urllib_parse.urljoin(base, "304/test_etag.txt")
(response, content) = self.http.request(
uri, "GET", headers={'accept-encoding': 'identity'})
self.assertNotEqual(response['etag'], "")
(response, content) = self.http.request(
uri, "GET", headers={'accept-encoding': 'identity'})
self.assertEqual(response.status, 200)
self.assertEqual(response.fromcache, True)
(response, content) = self.http.request(
uri, "GET", headers={
'accept-encoding': 'identity',
'Pragma': 'no-cache'})
self.assertEqual(response.status, 200)
self.assertEqual(response.fromcache, False)
评论列表
文章目录