Changeset 7577
- Timestamp:
- 06/06/08 08:39:42 (6 months ago)
- Files:
-
- django/trunk/django/test/client.py (modified) (2 diffs)
- django/trunk/tests/regressiontests/test_client_regress/views.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/test/client.py
r7330 r7577 1 1 import urllib 2 2 import sys 3 import os 3 4 from cStringIO import StringIO 4 5 from django.conf import settings … … 68 69 lines.extend([ 69 70 '--' + boundary, 70 'Content-Disposition: form-data; name="%s"; filename="%s"' % (to_str(key), to_str( value.name)),71 'Content-Disposition: form-data; name="%s"; filename="%s"' % (to_str(key), to_str(os.path.basename(value.name))), 71 72 'Content-Type: application/octet-stream', 72 73 '', django/trunk/tests/regressiontests/test_client_regress/views.py
r7330 r7577 1 import os 2 1 3 from django.contrib.auth.decorators import login_required 2 4 from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError … … 14 16 form_data.update(request.FILES) 15 17 if isinstance(form_data['file_field'], dict) and isinstance(form_data['name'], unicode): 18 # If a file is posted, the dummy client should only post the file name, 19 # not the full path. 20 if os.path.dirname(form_data['file_field']['filename']) != '': 21 return HttpResponseServerError() 16 22 return HttpResponse('') 17 23 else:
