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
cc1f6f26
Kaydet (Commit)
cc1f6f26
authored
Kas 20, 2016
tarafından
Adam Chainz
Kaydeden (comit)
Simon Charette
Kas 20, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #27514 -- Tested Model.__init__ excessive number of fields.
üst
a269018e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
base.py
django/db/models/base.py
+1
-2
tests.py
tests/model_regress/tests.py
+5
-0
No files found.
django/db/models/base.py
Dosyayı görüntüle @
cc1f6f26
...
...
@@ -472,8 +472,7 @@ class Model(six.with_metaclass(ModelBase)):
# overrides it. It should be one or the other; don't duplicate the work
# The reason for the kwargs check is that standard iterator passes in by
# args, and instantiation for iteration is 33% faster.
args_len
=
len
(
args
)
if
args_len
>
len
(
self
.
_meta
.
concrete_fields
):
if
len
(
args
)
>
len
(
self
.
_meta
.
concrete_fields
):
# Daft, but matches old exception sans the err msg.
raise
IndexError
(
"Number of args exceeds number of fields"
)
...
...
tests/model_regress/tests.py
Dosyayı görüntüle @
cc1f6f26
...
...
@@ -17,6 +17,11 @@ from .models import (
class
ModelTests
(
TestCase
):
def
test_model_init_too_many_args
(
self
):
msg
=
"Number of args exceeds number of fields"
with
self
.
assertRaisesMessage
(
IndexError
,
msg
):
Worker
(
1
,
2
,
3
,
4
)
# The bug is that the following queries would raise:
# "TypeError: Related Field has invalid lookup: gte"
def
test_related_gte_lookup
(
self
):
...
...
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