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
2110b179
Kaydet (Commit)
2110b179
authored
Ock 21, 2019
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Tested Model.set_FOO_order() with an unrelated object.
üst
130192b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
base_tests.py
tests/order_with_respect_to/base_tests.py
+7
-0
No files found.
tests/order_with_respect_to/base_tests.py
Dosyayı görüntüle @
2110b179
...
...
@@ -50,6 +50,13 @@ class BaseOrderWithRespectToTests:
a2
=
self
.
Answer
.
objects
.
create
(
text
=
"Number five"
,
question
=
self
.
q1
)
self
.
assertEqual
(
list
(
a1
.
question
.
get_answer_order
()),
list
(
a2
.
question
.
get_answer_order
()))
def
test_set_order_unrelated_object
(
self
):
"""An answer that's not related isn't updated."""
q
=
self
.
Question
.
objects
.
create
(
text
=
'other'
)
a
=
self
.
Answer
.
objects
.
create
(
text
=
'Number five'
,
question
=
q
)
self
.
q1
.
set_answer_order
([
o
.
pk
for
o
in
self
.
q1
.
answer_set
.
all
()]
+
[
a
.
pk
])
self
.
assertEqual
(
self
.
Answer
.
objects
.
get
(
pk
=
a
.
pk
)
.
_order
,
0
)
def
test_change_ordering
(
self
):
# The ordering can be altered
a
=
self
.
Answer
.
objects
.
create
(
text
=
"Number five"
,
question
=
self
.
q1
)
...
...
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