Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
a2b999df
Kaydet (Commit)
a2b999df
authored
Tem 12, 2015
tarafından
Yosuke Yasuda
Kaydeden (comit)
Tim Graham
Tem 13, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #25108 -- Fixed a test which failed on Pillow 2.9+
üst
97bc8752
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
test_fields.py
tests/forms_tests/tests/test_fields.py
+14
-10
No files found.
tests/forms_tests/tests/test_fields.py
Dosyayı görüntüle @
a2b999df
...
...
@@ -847,19 +847,23 @@ class FieldsTests(SimpleTestCase):
This also tests the situation when Pillow doesn't detect the MIME type
of the image (#24948).
"""
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
()
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
()
img_file
=
SimpleUploadedFile
(
'1x1.bmp'
,
img_data
)
img_file
.
content_type
=
'text/plain'
img_file
=
SimpleUploadedFile
(
'1x1.bmp'
,
img_data
)
img_file
.
content_type
=
'text/plain'
uploaded_file
=
f
.
clean
(
img_file
)
uploaded_file
=
f
.
clean
(
img_file
)
self
.
assertEqual
(
'BMP'
,
uploaded_file
.
image
.
format
)
self
.
assertIsNone
(
uploaded_file
.
content_type
)
self
.
assertEqual
(
'BMP'
,
uploaded_file
.
image
.
format
)
self
.
assertIsNone
(
uploaded_file
.
content_type
)
finally
:
Image
.
register_mime
(
BmpImageFile
.
format
,
'image/bmp'
)
# URLField ##################################################################
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment