mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	[4.0.x] Fixed #33132 -- Fixed test client handling of querystring only redirects.
Regression in1e5aa8e1c7. Backport ofb1bf8c8a4bfrom main
This commit is contained in:
		
				
					committed by
					
						 Carlton Gibson
						Carlton Gibson
					
				
			
			
				
	
			
			
			
						parent
						
							715aa2db67
						
					
				
				
					commit
					5d36af6f6f
				
			| @@ -85,6 +85,21 @@ def post_view(request): | ||||
|     return HttpResponse(t.render(c)) | ||||
|  | ||||
|  | ||||
| def post_then_get_view(request): | ||||
|     """ | ||||
|     A view that expects a POST request, returns a redirect response | ||||
|     to itself providing only a ?success=true querystring, | ||||
|     the value of this querystring is then rendered upon GET. | ||||
|     """ | ||||
|     if request.method == 'POST': | ||||
|         return HttpResponseRedirect('?success=true') | ||||
|  | ||||
|     t = Template('The value of success is {{ value }}.', name='GET Template') | ||||
|     c = Context({'value': request.GET.get('success', 'false')}) | ||||
|  | ||||
|     return HttpResponse(t.render(c)) | ||||
|  | ||||
|  | ||||
| def json_view(request): | ||||
|     """ | ||||
|     A view that expects a request with the header 'application/json' and JSON | ||||
|   | ||||
		Reference in New Issue
	
	Block a user