{{{
$ ./runtests.py ./forms_tests
Testing against Django installed in
'/Users/yasudayousuke/oss_hack/django_dev/django_parent/django'
Creating test database for alias 'default'...
Creating test database for alias 'other'...
..................................................................................................................F.....................................................................................................................................................................................................................................................................................................................s...........
======================================================================
FAIL: test_imagefield_annotate_with_bitmap_image_after_clean
(forms_tests.tests.test_fields.FieldsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/yasudayousuke/oss_hack/django_dev/django_parent/tests/forms_tests/tests/test_fields.py",
line 862, in test_imagefield_annotate_with_bitmap_image_after_clean
self.assertIsNone(uploaded_file.content_type)
AssertionError: 'image/bmp' is not None
}}}
Probably the cause is the change of library Pillow added few days ago.
https://github.com/python-
pillow/Pillow/commit/fe18b039ca9e11c6deed8f21a9e5eca815badbb7
My Pillow version is 2.9.0, so the content_type is "image/bmp" and is not
None.
--
Ticket URL: <https://code.djangoproject.com/ticket/25108>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "25108.diff" added.
* owner: nobody => double-y
* needs_better_patch: => 0
* status: new => assigned
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25108#comment:1>
* needs_better_patch: 0 => 1
* component: HTTP handling => Forms
* stage: Unreviewed => Accepted
Comment:
The original purpose of this test is to check the case when Pillow doesn't
detect the MIME type of the image, so we need to find a new case of that
if possible.
--
Ticket URL: <https://code.djangoproject.com/ticket/25108#comment:2>
Comment (by double-y):
Then, should I choose a different type of image which Pillow doesn't
detect the MIME type?
--
Ticket URL: <https://code.djangoproject.com/ticket/25108#comment:3>
Comment (by double-y):
Replying to [comment:2 timgraham]:
> The original purpose of this test is to check the case when Pillow
doesn't detect the MIME type of the image, so we need to find a new case
of that if possible.
Then, should I choose a different type of image which Pillow doesn't
detect the MIME type? Or can I set file extension which doesn't exist?
--
Ticket URL: <https://code.djangoproject.com/ticket/25108#comment:4>
Comment (by double-y):
I found a tga file can be ImageFile and its MIME type is not detected, so
I changed bmp to tga.
--
Ticket URL: <https://code.djangoproject.com/ticket/25108#comment:5>
Comment (by coldmind):
Yes, after previous ticket I added MIME for BMP, so it will fail.
I think it is better to use mock to model this situation instead of fixing
every time after Pillow registers MIME for image plugin without it.
--
Ticket URL: <https://code.djangoproject.com/ticket/25108#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"a2b999dfcac9bc92513a36ec6b3033ded1561c66" a2b999d]:
{{{
#!CommitTicketReference repository=""
revision="a2b999dfcac9bc92513a36ec6b3033ded1561c66"
Fixed #25108 -- Fixed a test which failed on Pillow 2.9+
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25108#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"269315d81a955b9352777961a76763a47fb61667" 269315d8]:
{{{
#!CommitTicketReference repository=""
revision="269315d81a955b9352777961a76763a47fb61667"
[1.8.x] Fixed #25108 -- Fixed a test which failed on Pillow 2.9+
Backport of a2b999dfcac9bc92513a36ec6b3033ded1561c66 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25108#comment:8>