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
2100bcef
Kaydet (Commit)
2100bcef
authored
Tem 08, 2014
tarafından
Daniel Pyrathon
Kaydeden (comit)
Tim Graham
Tem 08, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[1.7.x] Added a unit test to ensure models cannot be ordered by a M2M field.
Backport of
865bc717
from master
üst
9918b764
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
test_models.py
tests/invalid_models_tests/test_models.py
+21
-0
No files found.
tests/invalid_models_tests/test_models.py
Dosyayı görüntüle @
2100bcef
...
...
@@ -375,6 +375,27 @@ class OtherModelTests(IsolatedModelsTestCase):
]
self
.
assertEqual
(
errors
,
expected
)
def
test_non_valid
(
self
):
class
RelationModel
(
models
.
Model
):
pass
class
Model
(
models
.
Model
):
relation
=
models
.
ManyToManyField
(
RelationModel
)
class
Meta
:
ordering
=
[
'relation'
]
errors
=
Model
.
check
()
expected
=
[
Error
(
"'ordering' refers to the non-existent field 'relation'."
,
hint
=
None
,
obj
=
Model
,
id
=
'models.E015'
,
),
]
self
.
assertEqual
(
errors
,
expected
)
def
test_ordering_pointing_to_missing_field
(
self
):
class
Model
(
models
.
Model
):
class
Meta
:
...
...
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