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
c59aa9e6
Kaydet (Commit)
c59aa9e6
authored
Mar 28, 2018
tarafından
Mads Jensen
Kaydeden (comit)
Tim Graham
Mar 29, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added test for combining Q objects with non-Q objects.
üst
fbb93581
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
test_q.py
tests/queries/test_q.py
+8
-0
No files found.
tests/queries/test_q.py
Dosyayı görüntüle @
c59aa9e6
...
@@ -19,6 +19,14 @@ class QTests(SimpleTestCase):
...
@@ -19,6 +19,14 @@ class QTests(SimpleTestCase):
def
test_combine_or_both_empty
(
self
):
def
test_combine_or_both_empty
(
self
):
self
.
assertEqual
(
Q
()
|
Q
(),
Q
())
self
.
assertEqual
(
Q
()
|
Q
(),
Q
())
def
test_combine_not_q_object
(
self
):
obj
=
object
()
q
=
Q
(
x
=
1
)
with
self
.
assertRaisesMessage
(
TypeError
,
str
(
obj
)):
q
|
obj
with
self
.
assertRaisesMessage
(
TypeError
,
str
(
obj
)):
q
&
obj
def
test_deconstruct
(
self
):
def
test_deconstruct
(
self
):
q
=
Q
(
price__gt
=
F
(
'discounted_price'
))
q
=
Q
(
price__gt
=
F
(
'discounted_price'
))
path
,
args
,
kwargs
=
q
.
deconstruct
()
path
,
args
,
kwargs
=
q
.
deconstruct
()
...
...
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