mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #31789 -- Added a new headers interface to HttpResponse.
This commit is contained in:
committed by
Mariusz Felisiak
parent
71ae1ab012
commit
bcc2befd0e
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user