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
3fb718f1
Kaydet (Commit)
3fb718f1
authored
Şub 28, 2018
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Eliminated the need to modify a model forms test when new test files are added.
üst
5cc28dc7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
models.py
tests/model_forms/models.py
+1
-1
tests.py
tests/model_forms/tests.py
+2
-6
No files found.
tests/model_forms/models.py
Dosyayı görüntüle @
3fb718f1
...
@@ -151,7 +151,7 @@ class CustomFF(models.Model):
...
@@ -151,7 +151,7 @@ class CustomFF(models.Model):
class
FilePathModel
(
models
.
Model
):
class
FilePathModel
(
models
.
Model
):
path
=
models
.
FilePathField
(
path
=
os
.
path
.
dirname
(
__file__
),
match
=
r".*\.py$"
,
blank
=
True
)
path
=
models
.
FilePathField
(
path
=
os
.
path
.
dirname
(
__file__
),
match
=
'models.py'
,
blank
=
True
)
try
:
try
:
...
...
tests/model_forms/tests.py
Dosyayı görüntüle @
3fb718f1
...
@@ -2328,18 +2328,14 @@ class FileAndImageFieldTests(TestCase):
...
@@ -2328,18 +2328,14 @@ class FileAndImageFieldTests(TestCase):
p
.
image
.
delete
(
save
=
False
)
p
.
image
.
delete
(
save
=
False
)
def
test_file_path_field_blank
(
self
):
def
test_file_path_field_blank
(
self
):
"""
"""FilePathField(blank=True) includes the empty option."""
Regression test for #8842: FilePathField(blank=True)
"""
class
FPForm
(
forms
.
ModelForm
):
class
FPForm
(
forms
.
ModelForm
):
class
Meta
:
class
Meta
:
model
=
FilePathModel
model
=
FilePathModel
fields
=
'__all__'
fields
=
'__all__'
form
=
FPForm
()
form
=
FPForm
()
names
=
[
p
[
1
]
for
p
in
form
[
'path'
]
.
field
.
choices
]
self
.
assertEqual
([
name
for
_
,
name
in
form
[
'path'
]
.
field
.
choices
],
[
'---------'
,
'models.py'
])
names
.
sort
()
self
.
assertEqual
(
names
,
[
'---------'
,
'__init__.py'
,
'models.py'
,
'test_uuid.py'
,
'tests.py'
])
@skipUnless
(
test_images
,
"Pillow not installed"
)
@skipUnless
(
test_images
,
"Pillow not installed"
)
def
test_image_field
(
self
):
def
test_image_field
(
self
):
...
...
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