mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
A bunch of improvements for conditional HTTP processing.
Fixed some typos in the code (fixed #10586). Added more tests. Made the tests compatible with Python 2.3. Improved the documentation by putting the good news and common use-case right up front. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10134 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -98,6 +98,21 @@ class ConditionalGet(TestCase):
|
||||
response = self.client.get('/condition/etag/')
|
||||
self.assertFullResponse(response, check_last_modified=False)
|
||||
|
||||
def testSingleCondition5(self):
|
||||
self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR
|
||||
response = self.client.get('/condition/last_modified2/')
|
||||
self.assertNotModified(response)
|
||||
response = self.client.get('/condition/etag2/')
|
||||
self.assertFullResponse(response, check_last_modified=False)
|
||||
|
||||
def testSingleCondition6(self):
|
||||
self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG
|
||||
response = self.client.get('/condition/etag2/')
|
||||
self.assertNotModified(response)
|
||||
response = self.client.get('/condition/last_modified2/')
|
||||
self.assertFullResponse(response, check_etag=False)
|
||||
|
||||
|
||||
class ETagProcesing(TestCase):
|
||||
def testParsing(self):
|
||||
etags = parse_etags(r'"", "etag", "e\"t\"ag", "e\\tag", W/"weak"')
|
||||
|
||||
Reference in New Issue
Block a user