#11159: Test client encode_file doesn't set content-type properly
--------------------------------------+-------------------------------------
 Reporter:  notanumber                |       Owner:  nobody    
   Status:  new                       |   Milestone:            
Component:  Testing framework         |     Version:  1.0       
 Keywords:  encode_file content-type  |       Stage:  Unreviewed
Has_patch:  1                         |  
--------------------------------------+-------------------------------------
 The test client doesn't properly set the content-type when uploading
 files.  It hard-codes the content-type value to to 'application/octet-
 stream'.  This makes it difficult to test that code that relies on a
 specific content-type being set.

 The encode_file method could be easily changed to make use of
 mimetypes.guess_type to make a best guess attempt to set a content-type,
 falling back to the default 'application/octet-stream'.

 I've attached a patch that does this.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11159>
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to