Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14468 closed (fixed)

test_client_regress.models.UploadedFileEncodingTest fails if the mimetypes.guess_type() guesses an alternate zip mimetype

Reported by: Johannes Dollinger Owned by: nobody
Component: Testing framework Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

FAIL: test_guesses_content_type_on_file_encoding (regressiontests.test_client_regress.models.UploadedFileEncodingTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emulbreh/Projekte/django-dev/trunk/tests/regressiontests/test_client_regress/models.py", line 847, in test_guesses_content_type_on_file_encoding
    encode_file('IGNORE', 'IGNORE', DummyFile("file.zip"))[2])
AssertionError: 'Content-Type: application/zip' != 'Content-Type: application/x-zip-compressed'

Attachments (1)

14468.diff (1.0 KB) - added by Johannes Dollinger 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by Johannes Dollinger

Attachment: 14468.diff added

comment:1 Changed 6 years ago by Russell Keith-Magee

Has patch: set
Needs documentation: unset
Needs tests: unset
Patch needs improvement: set
Triage Stage: UnreviewedReady for checkin

In addition to application/x-zip-compressed, we should probably also be catching application/x-zip and application/x-compress. They're edge cases too; we might as well catch them while we're at it.

Marking RFC though, because adding the extra types into the patch is a trivial modification.

comment:2 Changed 6 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

(In [15236]) Fixed #14468 -- Extended the list of content types that the test client could guess when handling zip files. Thanks, Russ and emulbreh.

comment:3 Changed 6 years ago by Jannis Leidel

(In [15237]) [1.2.X] Fixed #14468 -- Extended the list of content types that the test client could guess when handling zip files. Thanks, Russ and emulbreh.

Backport from trunk (r15236).

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