#9480: django.test.client.FakePayload is truncating files ----------------------------------------+----------------------------------- Reporter: hellhound | Owner: nobody Status: closed | Milestone: 1.1 Component: Testing framework | Version: 1.0 Resolution: worksforme | Keywords: FakePayload file post client Stage: Accepted | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | ----------------------------------------+----------------------------------- Changes (by russellm):
* status: new => closed * resolution: => worksforme Comment: I can't reproduce this failure. Using the following view: {{{ def file_upload_view(request): "A view that validates integrity of file uploads" return render_to_response('base.html', { 'file': request.FILES['file'] }) }}} the following test case passes without error: {{{ class FileUploadTests(TestCase): def test_upload(self): testfile = os.path.join(os.path.dirname(__file__), 'fixtures', 'testdata.json') f = open(testfile) response = self.client.post('/test_client_regress/file_test/', {'file': f}) f.close() self.assertEqual(response.context['file'].size, os.stat(testfile).st_size) f.close() }}} If you can provide a failing test case, please reopen with more details. -- Ticket URL: <http://code.djangoproject.com/ticket/9480#comment:2> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---