diff --git a/docs/topics/class-based-views/index.txt b/docs/topics/class-based-views/index.txt index 6a629cb887..17e8b66f8f 100644 --- a/docs/topics/class-based-views/index.txt +++ b/docs/topics/class-based-views/index.txt @@ -118,7 +118,7 @@ And the view:: def head(self, *args, **kwargs): last_book = self.get_queryset().latest('publication_date') - response = HttpResponse('') + response = HttpResponse() # RFC 1123 date format response['Last-Modified'] = last_book.publication_date.strftime('%a, %d %b %Y %H:%M:%S GMT') return response diff --git a/tests/file_uploads/views.py b/tests/file_uploads/views.py index d4947e4134..1d1e745b71 100644 --- a/tests/file_uploads/views.py +++ b/tests/file_uploads/views.py @@ -20,7 +20,7 @@ def file_upload_view(request): # not the full path. if os.path.dirname(form_data['file_field'].name) != '': return HttpResponseServerError() - return HttpResponse('') + return HttpResponse() else: return HttpResponseServerError() @@ -50,7 +50,7 @@ def file_upload_view_verify(request): obj = FileModel() obj.testfile.save(largefile.name, largefile) - return HttpResponse('') + return HttpResponse() def file_upload_unicode_name(request): @@ -79,7 +79,7 @@ def file_upload_unicode_name(request): if response: return response else: - return HttpResponse('') + return HttpResponse() def file_upload_echo(request): @@ -157,4 +157,4 @@ def file_upload_content_type_extra(request): def file_upload_fd_closing(request, access): if access == 't': request.FILES # Trigger file parsing. - return HttpResponse('') + return HttpResponse() diff --git a/tests/middleware/views.py b/tests/middleware/views.py index 50e23d1782..3f8e055a53 100644 --- a/tests/middleware/views.py +++ b/tests/middleware/views.py @@ -2,4 +2,4 @@ from django.http import HttpResponse def empty_view(request, *args, **kwargs): - return HttpResponse('') + return HttpResponse() diff --git a/tests/project_template/views.py b/tests/project_template/views.py index 50e23d1782..3f8e055a53 100644 --- a/tests/project_template/views.py +++ b/tests/project_template/views.py @@ -2,4 +2,4 @@ from django.http import HttpResponse def empty_view(request, *args, **kwargs): - return HttpResponse('') + return HttpResponse() diff --git a/tests/servers/views.py b/tests/servers/views.py index 1db56f44a3..fa30b0ce7b 100644 --- a/tests/servers/views.py +++ b/tests/servers/views.py @@ -22,7 +22,7 @@ def model_view(request): def create_model_instance(request): person = Person(name='emily') person.save() - return HttpResponse('') + return HttpResponse() def environ_view(request): diff --git a/tests/test_client_regress/views.py b/tests/test_client_regress/views.py index 5e4c9968fd..f252cfc39f 100644 --- a/tests/test_client_regress/views.py +++ b/tests/test_client_regress/views.py @@ -21,7 +21,7 @@ def no_template_view(request): def staff_only_view(request): "A view that can only be visited by staff. Non staff members get an exception" if request.user.is_staff: - return HttpResponse('') + return HttpResponse() else: raise CustomTestException() diff --git a/tests/test_utils/views.py b/tests/test_utils/views.py index 6c30d07199..91d71f296d 100644 --- a/tests/test_utils/views.py +++ b/tests/test_utils/views.py @@ -16,4 +16,4 @@ def no_template_used(request): def empty_response(request): - return HttpResponse('') + return HttpResponse() diff --git a/tests/urlpatterns/views.py b/tests/urlpatterns/views.py index 50e23d1782..3f8e055a53 100644 --- a/tests/urlpatterns/views.py +++ b/tests/urlpatterns/views.py @@ -2,4 +2,4 @@ from django.http import HttpResponse def empty_view(request, *args, **kwargs): - return HttpResponse('') + return HttpResponse() diff --git a/tests/urlpatterns_reverse/views.py b/tests/urlpatterns_reverse/views.py index 584c70a6e5..3cf97723d4 100644 --- a/tests/urlpatterns_reverse/views.py +++ b/tests/urlpatterns_reverse/views.py @@ -7,11 +7,11 @@ from django.views.generic import RedirectView def empty_view(request, *args, **kwargs): - return HttpResponse('') + return HttpResponse() def absolute_kwargs_view(request, arg1=1, arg2=2): - return HttpResponse('') + return HttpResponse() def defaults_view(request, arg1, arg2): @@ -27,7 +27,7 @@ def erroneous_view(request): def pass_resolver_match_view(request, *args, **kwargs): - response = HttpResponse('') + response = HttpResponse() response.resolver_match = request.resolver_match return response @@ -37,7 +37,7 @@ uncallable = None # neither a callable nor a string class ViewClass: def __call__(self, request, *args, **kwargs): - return HttpResponse('') + return HttpResponse() view_class_instance = ViewClass()