Opened 8 years ago

Closed 6 years ago

#10115 closed (duplicate)

Allow test client to guess files' mimetypes

Reported by: Julien Phalip Owned by: nobody
Component: Testing framework Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Currently, all files posted through the test client are sent as 'application/octet-stream'. To test views that rely on mimetypes you have to create a request object from scratch, which is quite tedious. It'd be nice to allow python to guess the mimetypes (therefore simulating a browser's encoding) to make the process easier.

See discussion in django-users list: http://groups.google.com/group/django-users/browse_thread/thread/4e168903ec91b068

See also patch attached.

Attachments (1)

10115. test_mimetypes.diff (9.6 KB) - added by Julien Phalip 8 years ago.
Patch contains test and doc

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Julien Phalip

Attachment: 10115. test_mimetypes.diff added

Patch contains test and doc

comment:1 Changed 8 years ago by Julien Phalip

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

I'm not sure why the patch doesn't display correctly in Trac. You'll have to download it to see it.

comment:2 Changed 8 years ago by Eric Holscher

Triage Stage: UnreviewedAccepted

comment:3 Changed 6 years ago by Adam Nelson

Resolution: duplicate
Status: newclosed

Duplicate of #11159 (I know that one's newer but it has a test and everything on the latest codebase)

Note: See TracTickets for help on using tickets.
Back to Top