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
0cf158cf
Kaydet (Commit)
0cf158cf
authored
Mar 20, 2014
tarafından
Alex Gaynor
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed a small collection of flake8 violations that had snuck in
üst
3ecc25bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
tests.py
tests/model_forms/tests.py
+4
-3
No files found.
tests/model_forms/tests.py
Dosyayı görüntüle @
0cf158cf
...
...
@@ -1297,7 +1297,7 @@ class ModelFormBasicTests(TestCase):
self
.
assertEqual
(
Category
.
objects
.
get
(
id
=
cat
.
id
)
.
name
,
'Third'
)
def
test_runtime_choicefield_populated
(
self
):
self
.
maxDiff
=
None
self
.
maxDiff
=
None
# Here, we demonstrate that choices for a ForeignKey ChoiceField are determined
# at runtime, based on the data in the database when the form is displayed, not
# the data in the database when the form is instantiated.
...
...
@@ -1395,10 +1395,10 @@ class ModelChoiceFieldTests(TestCase):
self
.
assertEqual
(
f
.
clean
(
str
(
self
.
c1
.
id
))
.
name
,
"Entertainment"
)
with
self
.
assertRaises
(
ValidationError
):
f
.
clean
(
'100'
)
# len can be called on choices
self
.
assertEqual
(
len
(
f
.
choices
),
2
)
# queryset can be changed after the field is created.
f
.
queryset
=
Category
.
objects
.
exclude
(
name
=
'Third'
)
self
.
assertEqual
(
list
(
f
.
choices
),
[
...
...
@@ -1988,6 +1988,7 @@ class FileAndImageFieldTests(TestCase):
self
.
assertEqual
(
instance
.
image
.
name
,
'foo/test4.png'
)
instance
.
delete
()
class
ModelOtherFieldTests
(
TestCase
):
def
test_big_integer_field
(
self
):
bif
=
BigIntForm
({
'biggie'
:
'-9223372036854775808'
})
...
...
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