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
4cfccc71
Kaydet (Commit)
4cfccc71
authored
Eki 14, 2016
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Tested invalid QuerySet.order_by() arguments.
üst
f2dc6b3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
tests.py
tests/queries/tests.py
+11
-3
No files found.
tests/queries/tests.py
Dosyayı görüntüle @
4cfccc71
...
...
@@ -2946,7 +2946,7 @@ class WhereNodeTest(TestCase):
w
.
as_sql
(
compiler
,
connection
)
class
IteratorExceptionsTest
(
TestCase
):
class
QuerySetExceptionTests
(
TestCase
):
def
test_iter_exceptions
(
self
):
qs
=
ExtraInfo
.
objects
.
only
(
'author'
)
with
self
.
assertRaises
(
AttributeError
):
...
...
@@ -2956,11 +2956,19 @@ class IteratorExceptionsTest(TestCase):
# Test for #19895 - second iteration over invalid queryset
# raises errors.
qs
=
Article
.
objects
.
order_by
(
'invalid_column'
)
with
self
.
assertRaises
(
FieldError
):
msg
=
"Cannot resolve keyword 'invalid_column' into field."
with
self
.
assertRaisesMessage
(
FieldError
,
msg
):
list
(
qs
)
with
self
.
assertRaises
(
FieldError
):
with
self
.
assertRaises
Message
(
FieldError
,
msg
):
list
(
qs
)
def
test_invalid_order_by
(
self
):
msg
=
"Invalid order_by arguments: ['*']"
if
six
.
PY2
:
msg
=
msg
.
replace
(
"["
,
"[u"
)
with
self
.
assertRaisesMessage
(
FieldError
,
msg
):
list
(
Article
.
objects
.
order_by
(
'*'
))
class
NullJoinPromotionOrTest
(
TestCase
):
@classmethod
...
...
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