mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #31789 -- Added a new headers interface to HttpResponse.
This commit is contained in:
parent
71ae1ab012
commit
bcc2befd0e
47 changed files with 385 additions and 256 deletions
|
|
@ -21,12 +21,12 @@ class ConditionalGet(SimpleTestCase):
|
|||
self.assertEqual(response.content, FULL_RESPONSE.encode())
|
||||
if response.request['REQUEST_METHOD'] in ('GET', 'HEAD'):
|
||||
if check_last_modified:
|
||||
self.assertEqual(response['Last-Modified'], LAST_MODIFIED_STR)
|
||||
self.assertEqual(response.headers['Last-Modified'], LAST_MODIFIED_STR)
|
||||
if check_etag:
|
||||
self.assertEqual(response['ETag'], ETAG)
|
||||
self.assertEqual(response.headers['ETag'], ETAG)
|
||||
else:
|
||||
self.assertNotIn('Last-Modified', response)
|
||||
self.assertNotIn('ETag', response)
|
||||
self.assertNotIn('Last-Modified', response.headers)
|
||||
self.assertNotIn('ETag', response.headers)
|
||||
|
||||
def assertNotModified(self, response):
|
||||
self.assertEqual(response.status_code, 304)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue