mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
@@ -15,6 +15,7 @@ EXPIRED_LAST_MODIFIED_STR = 'Sat, 20 Oct 2007 23:21:47 GMT'
|
||||
ETAG = 'b4246ffc4f62314ca13147c9d4f76974'
|
||||
EXPIRED_ETAG = '7fae4cd4b0f81e7d2914700043aa8ed6'
|
||||
|
||||
|
||||
class ConditionalGet(TestCase):
|
||||
urls = 'conditional_processing.urls'
|
||||
|
||||
|
||||
@@ -8,18 +8,22 @@ def index(request):
|
||||
return HttpResponse(FULL_RESPONSE)
|
||||
index = condition(lambda r: ETAG, lambda r: LAST_MODIFIED)(index)
|
||||
|
||||
|
||||
def last_modified_view1(request):
|
||||
return HttpResponse(FULL_RESPONSE)
|
||||
last_modified_view1 = condition(last_modified_func=lambda r: LAST_MODIFIED)(last_modified_view1)
|
||||
|
||||
|
||||
def last_modified_view2(request):
|
||||
return HttpResponse(FULL_RESPONSE)
|
||||
last_modified_view2 = last_modified(lambda r: LAST_MODIFIED)(last_modified_view2)
|
||||
|
||||
|
||||
def etag_view1(request):
|
||||
return HttpResponse(FULL_RESPONSE)
|
||||
etag_view1 = condition(etag_func=lambda r: ETAG)(etag_view1)
|
||||
|
||||
|
||||
def etag_view2(request):
|
||||
return HttpResponse(FULL_RESPONSE)
|
||||
etag_view2 = etag(lambda r: ETAG)(etag_view2)
|
||||
|
||||
Reference in New Issue
Block a user