1
0
mirror of https://github.com/django/django.git synced 2025-10-10 15:29:11 +00:00
Malcolm Tredinnick d3980231ff unicode: Changed the way re-encoding of form field submission works so that
file uploads are no longer completely broken. Added tests for this as well.


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5464 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-11 20:02:08 +00:00

21 lines
721 B
Python

from django.core.mail import EmailMessage, SMTPConnection
from django.http import HttpResponse, HttpResponseServerError
from django.shortcuts import render_to_response
def no_template_view(request):
"A simple view that expects a GET request, and returns a rendered template"
return HttpResponse("No template used")
def file_upload_view(request):
"""
Check that a file upload can be updated into the POST dictionary without
going pear-shaped.
"""
form_data = request.POST.copy()
form_data.update(request.FILES)
if isinstance(form_data['file_field'], dict) and isinstance(form_data['name'], unicode):
return HttpResponse('')
else:
return HttpResponseServerError()