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
b137add6
Kaydet (Commit)
b137add6
authored
Haz 06, 2017
tarafından
Arne de Laat
Kaydeden (comit)
Tim Graham
Haz 07, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added FileExtensionValidator tests for uppercase and missing file extensions.
üst
c01409c7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
tests.py
tests/validators/tests.py
+7
-1
No files found.
tests/validators/tests.py
Dosyayı görüntüle @
b137add6
...
...
@@ -248,13 +248,19 @@ TEST_DATA = [
(
RegexValidator
(
'a'
,
flags
=
re
.
IGNORECASE
),
'A'
,
None
),
(
FileExtensionValidator
([
'txt'
]),
ContentFile
(
'contents'
,
name
=
'fileWithUnsupportedExt.jpg'
),
ValidationError
),
(
FileExtensionValidator
([
'txt'
]),
ContentFile
(
'contents'
,
name
=
'fileWithNoExtenstion'
),
ValidationError
),
(
FileExtensionValidator
([
'txt'
]),
ContentFile
(
'contents'
,
name
=
'fileWithUnsupportedExt.JPG'
),
ValidationError
),
(
FileExtensionValidator
([
'txt'
]),
ContentFile
(
'contents'
,
name
=
'fileWithNoExtension'
),
ValidationError
),
(
FileExtensionValidator
([
''
]),
ContentFile
(
'contents'
,
name
=
'fileWithAnExtension.txt'
),
ValidationError
),
(
FileExtensionValidator
([]),
ContentFile
(
'contents'
,
name
=
'file.txt'
),
ValidationError
),
(
FileExtensionValidator
([
''
]),
ContentFile
(
'contents'
,
name
=
'fileWithNoExtension'
),
None
),
(
FileExtensionValidator
([
'txt'
]),
ContentFile
(
'contents'
,
name
=
'file.txt'
),
None
),
(
FileExtensionValidator
([
'txt'
]),
ContentFile
(
'contents'
,
name
=
'file.TXT'
),
None
),
(
FileExtensionValidator
(),
ContentFile
(
'contents'
,
name
=
'file.jpg'
),
None
),
(
validate_image_file_extension
,
ContentFile
(
'contents'
,
name
=
'file.jpg'
),
None
),
(
validate_image_file_extension
,
ContentFile
(
'contents'
,
name
=
'file.png'
),
None
),
(
validate_image_file_extension
,
ContentFile
(
'contents'
,
name
=
'file.PNG'
),
None
),
(
validate_image_file_extension
,
ContentFile
(
'contents'
,
name
=
'file.txt'
),
ValidationError
),
(
validate_image_file_extension
,
ContentFile
(
'contents'
,
name
=
'file'
),
ValidationError
),
]
...
...
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