Loading tests/forms_tests/tests/test_fields.py +14 −10 Original line number Diff line number Diff line Loading @@ -847,8 +847,10 @@ class FieldsTests(SimpleTestCase): This also tests the situation when Pillow doesn't detect the MIME type of the image (#24948). """ from PIL.BmpImagePlugin import BmpImageFile try: Image.register_mime(BmpImageFile.format, None) f = ImageField() img_path = os.path.dirname(upath(__file__)) + '/filepath_test_files/1x1.bmp' with open(img_path, 'rb') as img_file: img_data = img_file.read() Loading @@ -860,6 +862,8 @@ class FieldsTests(SimpleTestCase): self.assertEqual('BMP', uploaded_file.image.format) self.assertIsNone(uploaded_file.content_type) finally: Image.register_mime(BmpImageFile.format, 'image/bmp') # URLField ################################################################## Loading Loading
tests/forms_tests/tests/test_fields.py +14 −10 Original line number Diff line number Diff line Loading @@ -847,8 +847,10 @@ class FieldsTests(SimpleTestCase): This also tests the situation when Pillow doesn't detect the MIME type of the image (#24948). """ from PIL.BmpImagePlugin import BmpImageFile try: Image.register_mime(BmpImageFile.format, None) f = ImageField() img_path = os.path.dirname(upath(__file__)) + '/filepath_test_files/1x1.bmp' with open(img_path, 'rb') as img_file: img_data = img_file.read() Loading @@ -860,6 +862,8 @@ class FieldsTests(SimpleTestCase): self.assertEqual('BMP', uploaded_file.image.format) self.assertIsNone(uploaded_file.content_type) finally: Image.register_mime(BmpImageFile.format, 'image/bmp') # URLField ################################################################## Loading