Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#14468 closed (fixed)

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

Reported by: emulbreh 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 emulbreh 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by emulbreh

comment:1 Changed 4 years ago by russellm

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Ready 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 4 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

(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 4 years ago by jezdez

(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